是否可以在matplotlib中重新打開封閉的圖形(即,一個用戶X'd)?下面的代碼顯示了原始的方法:Matplotlib:重新打開一個封閉的數字?
In [14]: fig = figure(10)
In [15]: close(fig)
In [16]: fig.show()
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1410, in __call__
return self.func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 495, in callit
func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 253, in idle_draw
self.draw()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 239, in draw
tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/tkagg.py", line 19, in blit
tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox_array))
TclError: this isn't a Tk application
我試圖創建一個含有小部件的數字,所以可行的解決方法(只是做一個新的數字),但我想知道,如果figure
實例關閉後完全沒用。
[Matplotlib:如何顯示已關閉的圖形]的可能重複(http://stackoverflow.com/questions/31729948/matplotlib-how-to-show-a-figure-that-has-been-關閉) – 2015-07-31 12:50:53