On 08/12/2011 01:56 PM, Christopher Brown 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)
That looks pretty convoluted. What are you really trying to do, and why? It looks like you are trying to transplant an Axes from one figure to another; add_axes doesn't do that. I'm not sure add_axes should even include a signature in which an axes instance is the argument; it is part of the behavior in which add_axes returns an existing Axes if it can find one that matches the requested args and kwargs. There was probably a good reason for this, but it looks to me like excessive overloading of add_axes--making it do something other than what its name clearly states it should do. The Figure instance is a required argument when creating an Axes instance. Axes are not designed to be copied or moved between figures, as far as I can see. Eric > > 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 > > ------------------------------------------------------------------------------ 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