Re: [Matplotlib-users] closing figure inside a callback seg faults

2010-10-18 Thread Michael Droettboom
I seem to have run into this problem with wx years ago -- destroying the widget that fed an event from a callback causes issues. As Chris suggested, the following seems to work, however: import matplotlib.pyplot as plt import wx def close_figure(): plt.close() def onclick(event): if

Re: [Matplotlib-users] closing figure inside a callback seg faults

2010-10-15 Thread Chris Barker
On 10/15/10 5:16 PM, Paul Ivanov wrote: > I want to do something like this: > >import matplotlib.pyplot as plt >def onclick(event): >if event.button==1: > plt.close() >fig = plt.gcf() >cid = fig.canvas.mpl_connect('button_press_event', onclick) >plt.show() > > I've