Hi Eric, On Mar 7, 2013, at 14:42 PM, Eric Firing <efir...@hawaii.edu> wrote:
> I think there is a simpler way. Does this do what you want? > > fig, axs = plt.subplots(nrows=2, sharex=True) > axs[0].set_aspect(0.7, adjustable='datalim') > axs[0].plot(np.random.rand(5)) > axs[1].plot(np.random.rand(7)) > plt.show() > > Note that when you set the aspect, it is not applied until there is a > draw() operation. Not quite, but the fact that I need to call get_position after a draw() call does help. The below works, though simpler ways are very welcome. Your method zoomed out the first plot's ylimits rather than shrunk the second plot's x axis size, which isn't what I want if the first plot is geographic. Thanks, Jody lonz=arange(40.,42.,0.1) latz = arange(38.,40.,0.1) lons = arange(40.,42.,0.3) dats = rand(shape(lons)[0]) Z = rand(shape(latz)[0],shape(lonz)[0]) ax=subplot2grid((3,1),(0,0),rowspan=2) pcolormesh(lonz,latz,Z) ax.set_aspect(cos(39*pi/180.)) draw() pp=ax.get_position().bounds xl=ax.get_xlim() axn=subplot2grid((3,1),(2,0)) plot(lons,dats) ppn = axn.get_position().bounds axn.set_position([pp[0],ppn[1],pp[2],ppn[3]]) xlim(xl) -- Jody Klymak http://web.uvic.ca/~jklymak/ ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users