From: Fernando P. <Fer...@co...> - 2005-02-01 23:49:30
|
John Hunter wrote: >>>>>>"Fernando" == Fernando Perez <Fer...@co...> writes: > > > Fernando> Finally, is this really a close bug? > > Fernando> In [20]: fig=plot(range(10)) > > Fernando> In [21]: close(fig) ERROR: Unrecognized argument type to > Fernando> close > > No, its a Fernando bug :-) > > plot returns a list of Line2D instances. Perhaps you mean > > fig = figure() > plot(range(10)) > close(fig) No, it's a John bug :) I also had tried that, and this is what I get with TkAgg: In [4]: fig=figure() In [5]: plot(range(10)) Out[5]: [<matplotlib.lines.Line2D instance at 0x4110494c>] In [6]: close(fig) --------------------------------------------------------------------------- exceptions.AttributeError Traceback (most recent call last) /home/fperez/code/python/pylab/<console> /usr/lib/python2.3/site-packages/matplotlib/pylab.py in close(*args) 611 elif isinstance(arg, Figure): 612 for manager in _pylab_helpers.Gcf.get_all_fig_managers(): --> 613 if manager.figure==arg: 614 _pylab_helpers.Gcf.destroy(manager.num) 615 else: AttributeError: FigureManagerTkAgg instance has no attribute 'figure' Which is why I thought it might be the other way around. So this may be a backend-specifig bug. But still a bug :) Cheers, f |