Christopher Brown, on 2011-08-12 16:56,  wrote:
> I feel like I'm doing this right, but it doesn't work. Any clues?
> 
> from matplotlib import pyplot as pp
> 
> pp.plot((1,2,3))
> ax = pp.gca()
> f = pp.figure(num=2)
> print 'first: %i' % ax.figure.number
> print 'second: %i' % f.number
> f.add_axes(ax)
> 
> yields:
> 
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 606, 
> in add_axes
>      assert(a.get_figure() is self)
> AssertionError

Right now, matplotlib allows an axes to participate in only one
figure. You can get part-way to what you want by setting
ax.figure=f before calling f.add_axes(ax). Then, you'll have ax
in both figures, but its transforms are still rooted in the first
figure, so resizing the first figure, you'll see changes to the
size of the plot in the second figure.

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy 
to use, easy to manage, easy to install, easy to extend. 
Get a Free download of the new open ALM Subversion platform now.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to