Plotting problems with matplotlib

I think this is an example where the IPython method of using threads to
interactively execute gtk commands does not work.
A minimal example that gives the same problem:

$ ipython -gthread
In [1]: import gtk
In [2]: md=gtk.MessageDialog(buttons=gtk.BUTTONS_CLOSE,
message_format="message")
In [3]: md.run()

gtk_dialog_run() blocks in a recursive main loop until the dialog either
emits the response signal, or is destroyed.
This gives the effect of a modal dialog. It works fine from within a GTK
program, but gives problems when used through IPython.

Regards
Steve

Send instant messages to your online friends http://au.messenger.yahoo.com

···

On Fri, 2005-07-01 at 20:28 -0700, matplotlib-users-request@lists.sourceforge.net wrote:

Eric Emsellem wrote:
> Hi,
> a short report on 2 minor problems I face with matplotlib:
>
> - I tried to save a figure in gif. It gave me back an error message
> saying that basically this is not supported. This is fine of course.
> However, then the plot window crashed, and then the whole Ipython
> session. It would be useful then to have this error not affecting the
> session in this way if possible.

I can see the problem in the GTK backend, but all other backends I tried under
linux (TkAgg, QtAgg and WXAgg) all behave correctly. This seems like a bug in
the GTK backend to me: it puts out to the screen an error message box, but the
OK button in that box is unresponsive. Eventually the window manager just
kills the window, which brings the whole python process down with it.

I don't know the backends enough to know what the right solution should be here.

Steve Chaplin wrote:

···

On Fri, 2005-07-01 at 20:28 -0700, > matplotlib-users-request@lists.sourceforge.net wrote:

Eric Emsellem wrote:

Hi,
a short report on 2 minor problems I face with matplotlib:

- I tried to save a figure in gif. It gave me back an error message saying that basically this is not supported. This is fine of course. However, then the plot window crashed, and then the whole Ipython session. It would be useful then to have this error not affecting the session in this way if possible.

I can see the problem in the GTK backend, but all other backends I tried under linux (TkAgg, QtAgg and WXAgg) all behave correctly. This seems like a bug in the GTK backend to me: it puts out to the screen an error message box, but the OK button in that box is unresponsive. Eventually the window manager just kills the window, which brings the whole python process down with it.

I don't know the backends enough to know what the right solution should be here.

I think this is an example where the IPython method of using threads to
interactively execute gtk commands does not work.
A minimal example that gives the same problem:

$ ipython -gthread
In [1]: import gtk
In [2]: md=gtk.MessageDialog(buttons=gtk.BUTTONS_CLOSE,
message_format="message")
In [3]: md.run()

gtk_dialog_run() blocks in a recursive main loop until the dialog either
emits the response signal, or is destroyed.
This gives the effect of a modal dialog. It works fine from within a GTK
program, but gives problems when used through IPython.

Mmh, I just don't know enough about GTK to consider what the right approach should be. Is this something that ipython should handle differently? I'll gladly incorporate any fixes, if I knew what they need to be :slight_smile:

Cheers,

f