Re: [Matplotlib-users] Subplots from existing figures

2008-03-05 Thread Christiaan Putter
Hi guys, I've been wanting to do something similar as well. Create a figure from other figures. The function accepts a list of figures, and according to the ratio (rows to columns) creates a bigger figure of appropriate size and 'copies' the axes into the new figure. I calculate the positions a

Re: [Matplotlib-users] Subplots from existing figures

2008-02-18 Thread Robin
Thanks very much for all your help. On Feb 18, 2008 3:44 PM, John Hunter <[EMAIL PROTECTED]> wrote: > It's not that it isn't supported, it's just rarely used and so may > have slowly broken over time. It is useful, so It would be worthwhile > for us to fix it. Are you using 0.91.2 or svn? I am

Re: [Matplotlib-users] Subplots from existing figures

2008-02-18 Thread John Hunter
On Feb 18, 2008 9:34 AM, Robin <[EMAIL PROTECTED]> wrote: > figs = [x[0] for x in results] > oldaxs = [fig.get_children()[1] for fig in figs] > for fig, ax in zip(figs,oldaxs): > fig.delaxes(ax) > pl.close(fig) Probably better: oldaxs = [] for fig in figs: for ax in fig.axes:

Re: [Matplotlib-users] Subplots from existing figures

2008-02-18 Thread Robin
On Feb 18, 2008 2:00 PM, John Hunter <[EMAIL PROTECTED]> wrote: > You will need to remove the axes from the original figure: > > oldfig.delaxes(ax) > > > and then add it to the new figure > > ax.set_figure(newfig) > newfig.add_axes(ax) > > If you are adding several, you may want to play with

Re: [Matplotlib-users] Subplots from existing figures

2008-02-18 Thread John Hunter
On Feb 18, 2008 1:43 AM, Robin <[EMAIL PROTECTED]> wrote: > If I move the axes over as you describe, will this also bring the > plotted data, titles etc.? I will try and play around with this later > today. Would I first have to delete the existing axes created when I > create the subplot? Wouldn'

Re: [Matplotlib-users] Subplots from existing figures

2008-02-17 Thread Robin
On Feb 18, 2008 4:44 AM, Eric Firing <[EMAIL PROTECTED]> wrote: > I'm not sure I understand what you want to do; is it to recycle axes > objects that were originally in one or more figures and put them in > another figure? Hi, I have a number of figures created from functions like this: fig1 = pl

Re: [Matplotlib-users] Subplots from existing figures

2008-02-17 Thread Eric Firing
Robin, I'm not sure I understand what you want to do; is it to recycle axes objects that were originally in one or more figures and put them in another figure? It looks like that might be doable if you create the new figure, then for each axes call ax.set_figure(newfig), and then for each axe

Re: [Matplotlib-users] Subplots from existing figures

2008-02-17 Thread Robin
On Feb 15, 2008 12:04 PM, Robin <[EMAIL PROTECTED]> wrote: > Hello, > > I have some functions that produce various figures. This is usually > done by calling figure(), then the plot function (eg bar). I save the > figure object and pass it out. > > I would like to be able to collect several figure