Controlling the wxpython matplotlib-frame

Hello all,
I have trouble with one of my scripts that uses matplotlib when using python or ipython. The first time it opens, it does not hand the control back o the shell and can be used to work on the matplotlib figure interactively (I use an event handler and picker objects to change my plots) so it works really well. After I close the window the control is given back to the shell. This is how I want it to work, however at the second time the matplotlib plot opens the shell does not stop anymore, the script continues. When I used GTKAgg on my old linux box I had the same issue and bound a key to pylab.get_current_figure_manager().destroy(), which looked like a hack to me but worked. This does not work anymore with wxPython, because the next time I open a plot I get an exception:

PyDeadObjectError: The C++ part of the FigureFrameWxAgg object has been deleted, attribute access no longer allowed.

I also think destroying the figure_manager is not the right way to do that. Whats a goog solution for this?
Thanks in advance
     Wolfgang

P.S.: I know I posted a similar thing yesterday, but I thought rephrasing the question might help with finding the solution

Have you tryied : ipython -pylab ?
It launch an ipython shell that support mathplotlib gui loop.

-----Message d'origine-----

···

De : wxpython-users-bounces+laurent.dufrechou=free.fr@…229…
[mailto:wxpython-users-bounces+laurent.dufrechou=free.fr@…229…
] De la part de Wolfgang Kerzendorf
Envoyé : mercredi 26 mars 2008 08:31
À : matplotlib-users@lists.sourceforge.net;
wxPython-users@…229…
Objet : [wxpython-users] Controlling the wxpython matplotlib-frame

Hello all,
I have trouble with one of my scripts that uses matplotlib when using
python or ipython. The first time it opens, it does not hand the
control back o the shell and can be used to work on the matplotlib
figure interactively (I use an event handler and picker objects to
change my plots) so it works really well. After I close the window the
control is given back to the shell. This is how I want it to work,
however at the second time the matplotlib plot opens the shell does
not stop anymore, the script continues. When I used GTKAgg on my old
linux box I had the same issue and bound a key to
pylab.get_current_figure_manager().destroy(), which looked like a hack
to me but worked. This does not work anymore with wxPython, because
the next time I open a plot I get an exception:

PyDeadObjectError: The C++ part of the FigureFrameWxAgg object has
been deleted, attribute access no longer allowed.

I also think destroying the figure_manager is not the right way to do
that. Whats a goog solution for this?
Thanks in advance
     Wolfgang

P.S.: I know I posted a similar thing yesterday, but I thought
rephrasing the question might help with finding the solution
_______________________________________________
wxpython-users mailing list
wxpython-users@...229...
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users