|
From: Tom V. <to...@so...> - 2009-07-16 17:39:25
|
On Tue, Jun 2, 2009 at 07:33, John Hunter<jd...@gm...> wrote: > On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan <to...@so...> wrote: >> Is it possible to add subplots to a figure if I don't know in advance >> how many subplots I need to add? >> >> What I do now is I call add_subplot like add_subplot(i, 1, i) where i >> is 1 initially, and just increases by 1 on each call. This almost >> works. Except the first plot takes up the whole figure, the second >> plot is placed on top of the bottom half of the first plot, etc. Is >> there a way to "resize" the plots when a subplot is added? Or how >> would I "re-plot" the previous subplots? > > See the Axes.change_geometry command > > http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.SubplotBase.change_geometry twinx() does not return an axes that contains the change_geometry method. How then can I do the equivalent on this axes? Calling twinx() again on the original axes after change_geometry() has been called does not do the trick. Thanks. -Tom |