## matplotlib-users

 [Matplotlib-users] Unequal size gangplots From: Jeremy Conlin - 2010-06-21 19:13:27 ```I have followed this excellent example: http://matplotlib.sourceforge.net/examples/pylab_examples/ganged_plots.html but I would like my plots to be 2/3 and 1/3 of the total height of the figure (I only have 2 plots). What do I have to do to specify the relative sizes of the figures? Thanks, Jeremy ```
 Re: [Matplotlib-users] Unequal size gangplots From: Malte Dik - 2010-06-21 19:49:50 ```Jeremy Conlin > I have followed this excellent example: > http://matplotlib.sourceforge.net/examples/pylab_examples/ganged_plots.html > > but I would like my plots to be 2/3 and 1/3 of the total height of the > figure (I only have 2 plots). What do I have to do to specify the > relative sizes of the figures? may something like ax1 = fig.add_subplot(311) ax2 = fig.add_subplot(212) work? if I look at pyplot.setp(ax1) I see a lot of things (like "position" or "anchor" or "axes_locator") which might work. Good luck, Malte ```
 Re: [Matplotlib-users] Unequal size gangplots From: Jeffrey Blackburne - 2010-06-21 20:31:32 ```I have used add_axes() to do this in the past. E.g., import matplotlib.pyplot as plt fig = plt.figure() leftmarg = 0.125 # change these numbers to taste botmmarg = 0.125 width = 0.825 height = 0.825 frac = 2./3. ax0 = fig.add_axes([leftmarg, botmmarg, width, frac*height]) ax1 = fig.add_axes([leftmarg, botmmarg+frac*height, width, (1-frac) *height]) ax1.xaxis.set_ticklabels([]) plt.show() Sorry it is in object-oriented style instead of pylab style... On Jun 21, 2010, at 3:13 PM, Jeremy Conlin wrote: > I have followed this excellent example: > http://matplotlib.sourceforge.net/examples/pylab_examples/ > ganged_plots.html > > but I would like my plots to be 2/3 and 1/3 of the total height of the > figure (I only have 2 plots). What do I have to do to specify the > relative sizes of the figures? > > Thanks, > Jeremy > > ---------------------------------------------------------------------- > -------- > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] Unequal size gangplots From: Jeremy Conlin - 2010-06-21 20:33:27 ```On Mon, Jun 21, 2010 at 2:33 PM, Jeffrey Blackburne wrote: > I have used add_axes() to do this in the past. E.g., > > import matplotlib.pyplot as plt > > fig = plt.figure() > leftmarg = 0.125   # change these numbers to taste > botmmarg = 0.125 > width = 0.825 > height = 0.825 > frac = 2./3. > ax0 = fig.add_axes([leftmarg, botmmarg, width, frac*height]) > ax1 = fig.add_axes([leftmarg, botmmarg+frac*height, width, (1-frac)*height]) > ax1.xaxis.set_ticklabels([]) > plt.show() > > Sorry it is in object-oriented style instead of pylab style... > Thanks! This looks like it might work. I'll give it a try. Jeremy ```
 Re: [Matplotlib-users] Unequal size gangplots From: Alan G Isaac - 2010-06-21 20:40:30 ```You should be able to use http://leejjoon.github.com/mpl_toolkits-gridspec/ for unequal-size plots of the type you describe. Alan Isaac ```