Although it is a bit inelegant, you could use the _pylab_helpers
module to see how many figure managers are active
home:~> ipython -pylab
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
Type "copyright", "credits" or "license" for more information.
IPython 0.9.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
Welcome to pylab, a matplotlib-based Python environment.
For more information, type 'help(pylab)'.
In : plot([1,2,3])
Out: [<matplotlib.lines.Line2D object at 0x46bfd70>]
In : import matplotlib._pylab_helpers as _pylab_helpers
In : print _pylab_helpers.Gcf.get_num_fig_managers()
On Thu, Apr 9, 2009 at 4:02 PM, mm2ps <dug@...2549...> wrote:
How would you check that there is something to show() before you show()?