João Luís Silva wrote: > Eric Firing wrote: >> I added two functions to pyplot in svn: fignum_exists(num) and >> get_fignums() so that with future releases you won't have to delve into >> _pylab_helpers for this information. >> >> Eric > > Wouldn't it be better to have some way to iterate mpl objects, rather > than having adhoc functions just for figures? I though there was a > standard way to iterate all figures, all axes etc, something like > > import matplotlib as mpl > > for fig in mpl.Figures: > ... do stuff > > or something similar. Does something like this exist in mpl?
No. The functions I added to pyplot were to provide more information about the figure tracking that pyplot does via the odd Gcf class in _pylab_helpers. This is based on the Matlab practice of having numbered figures. When the pyplot interface is *not* being used (see examples/api/agg_oo.py and examples/user_interfaces/embedding*.py), a Figure instance is just that--an instance of a class. Tracking the instances is up to the user, who presumably created them. The figure is at the top of the Artist hierarchy. It *does* track axes that are added to it, and you can iterate over those; and those axes track artists that are added to them. Is there a real need for module-level tracking of Figure instances in this case where pyplot is not being used? When pyplot is being used, one can always use pyplot.figure(num) to get the Figure object with that number. Eric ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users