SaveFig bug in TkAgg backend


When the "save" button is used on the matplotlib tkagg toolbar, it
uses the "Tk" "asksavefilename" object from the "tkFileDialog" class,
to pop up a little window that allows you to select the name and type
of file to save. This function internally calls "figure.destroy()".
and the currently active figure gets destroyed (but it is still visible
and memory is not freed). The next plot then creates a new figure
window with the same figure._num as the previous.

see... : line 621
-> class NavigationToolbar2TkAgg :: def save_figure(...)
(callback for the toolbar.bsave button)

The "asksavefilename" function call, triggers Gcf.destroy(). This can
be seen by placing a print statement in : line 16
-> class Gcf :: def destroy(num)

A script to trigger this is attached
Does anyone else see this, and does anyone have a way to fix this ?

Thank you very much !
Urvashi Rau (565 Bytes)