Re: [Matplotlib-users] dynamically add subplots to figure

2009-08-12 Thread Tom Vaughan
Great. That worked. Thanks! -Tom On Thu, Jul 16, 2009 at 11:23, Jae-Joon Lee wrote: > One work around is to call > >  self.figure.subplots_adjust() > > after geometry changed. After this call, the twinx-ed axes will have > the same axes position as the original one. > > Another option is to use

Re: [Matplotlib-users] dynamically add subplots to figure

2009-07-16 Thread Jae-Joon Lee
One work around is to call self.figure.subplots_adjust() after geometry changed. After this call, the twinx-ed axes will have the same axes position as the original one. Another option is to use mpl_toolkits.axes_grid (http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.htm

Re: [Matplotlib-users] dynamically add subplots to figure

2009-07-16 Thread Tom Vaughan
On Tue, Jun 2, 2009 at 07:33, John Hunter wrote: > On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan 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 ini

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread John Hunter
On Tue, Jun 2, 2009 at 4:34 PM, Christopher Barker wrote: >> I think the relevant parts are: >> >> from matplotlib.figure import Figure > >> self.__axl = self.figure.gca() > > I don't know what your issue is, but I thin you will be ell served to > use the OO interf

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread Christopher Barker
Tom Vaughan wrote: >> post some code >> > > I thought this might be required... > > So the whole thing is excessively complex. It can be very instructive to write a little app that just tests the issue at hand -- it may help you figure out what's wrong, and if not, you will have a self-contain

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread Tom Vaughan
On Tue, Jun 2, 2009 at 11:59, John Hunter wrote: > On Tue, Jun 2, 2009 at 1:51 PM, Tom Vaughan wrote: >> On Tue, Jun 2, 2009 at 07:33, John Hunter wrote: >>> On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan wrote: Is it possible to add subplots to a figure if I don't know in advance how many

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread John Hunter
On Tue, Jun 2, 2009 at 1:51 PM, Tom Vaughan wrote: > On Tue, Jun 2, 2009 at 07:33, John Hunter wrote: >> On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan 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 cal

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread Tom Vaughan
On Tue, Jun 2, 2009 at 07:33, John Hunter wrote: > On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan 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 ini

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread Tom Vaughan
On Tue, Jun 2, 2009 at 08:40, John Hunter wrote: > On Tue, Jun 2, 2009 at 10:18 AM, Tom Vaughan wrote: > >> Interestingly, if I were to 'print dir(self.figure.axes[i])' I can see >> the change_geometry attribute, but when I attempt to call it, I am >> told "AttributeError: 'AxesSubplot' object has

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread Tom Vaughan
On Tue, Jun 2, 2009 at 07:33, John Hunter wrote: > On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan 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 ini

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread John Hunter
On Tue, Jun 2, 2009 at 10:18 AM, Tom Vaughan wrote: > Interestingly, if I were to 'print dir(self.figure.axes[i])' I can see > the change_geometry attribute, but when I attempt to call it, I am > told "AttributeError: 'AxesSubplot' object has no attribute > 'change_geomtry'" This lead me to what

Re: [Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread John Hunter
On Tue, Jun 2, 2009 at 9:03 AM, Tom Vaughan 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 almos

[Matplotlib-users] dynamically add subplots to figure

2009-06-02 Thread Tom Vaughan
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