On Wed, Mar 12, 2008 at 7:37 PM, Christiaan Putter
<[EMAIL PROTECTED]> wrote:
>
> Look for a thread titled 'subplots from existing figures' (5th March) or
> something similar.  I posted a function there that takes in a list of
> figures and spits out a new one containing those.  There is still a bug in
> it though.  For some reason copying axes from one figure to another seems to
> be broken. ie. the axes can't be resized properly after being copied.

I had tried a similar thing, only less general (I only had two plots
to add to the same figure). I hit the same problem - the axes wouldn't
resize when the window was resized, and also some of my axes tick
labels were lost (oddly the first xticklabel was there but the others
were missing).

I found a way round it by getting the individual plotting functions to
accept an optional axes argument that they plot to...

def make_one_fig(ax=None):
    fig = None
    if ax is None:
        fig = figure() ...
        ax = fig.add_subplot(111)
    ax.plot (..)
    return fig

Then if called without ax set this plots as before, but if you want to
build up a set of plots:
fig = figure()
ax = fig.subplot(211)
make_one_plot(ax=ax)
etc

Robin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to