[SciPy-user] ANN matplotlib-0.30 - matlab style python plotting

I'm observing some difference in behavior between the two

    > versions. Running some example code in 0.29, after closing
    > the plot windows, the python.exe process quits normally.
    > The same example using 0.30 hangs the process and I have to
    > kill it by hand. This occurs both at the command line and
    > from within my editor (normally I execute from the editor).

    > Any ideas? Do I need to change some set up from when I was
    > using 0.29?

Yes. I made several changes to this part of matplotlib to iron out
some interactive bugs, and a new one crept in; I didn't notice it in
my tests. The quick fix is to add the following code to
matplotlib/backends/backend_gtk.py at line 773

        if GcfGTK.get_num_figwins()==0 and ShowOn().is_mainloop_on():
            gtk.mainquit()

This is in the GcfGTK.destroy function, so the entire function should
read

    def destroy(num):
        if not GcfBase.has_fignum(num): return
        figwin = GcfGTK.figs[num]
        figwin.figure.drawable= None
        GcfBase.destroy(num)
        if GcfGTK.get_num_figwins()==0 and ShowOn().is_mainloop_on():
            gtk.mainquit()
    destroy = staticmethod(destroy)

This should restore the old functionality -- let me know if you see
anymore strangeness. I'll check the change into CVS.

[BTW, I posted the 0.30 announce to this mailing list this afternoon,
but it didn't seem to make it. Hmmm.... Have I been moderated out of
existence :slight_smile: ]

Thanks for the bug report,
John Hunter

Thanks John. That fixed the hanging process.

Now a message is coming back "none active" from the
function:

    def _get_active(self):
        if len(GcfBase._activeQue)==0:
            print 'None active'
            return None
        else: return self._activeQue[-1]

in the _matlab_helpers.py file.

I haven't traced it back further yet.

Cheers.
Barry

--- John Hunter <jdhunter@...4...> wrote:

···

>>>>> "Barry" == Barry Drake <bldrake@...26...>
writes:

    > I'm observing some difference in behavior
between the two
    > versions. Running some example code in
0.29, after closing
    > the plot windows, the python.exe process
quits normally.
    > The same example using 0.30 hangs the
process and I have to
    > kill it by hand. This occurs both at the
command line and
    > from within my editor (normally I execute
from the editor).

    > Any ideas? Do I need to change some set
up from when I was
    > using 0.29?

Yes. I made several changes to this part of
matplotlib to iron out
some interactive bugs, and a new one crept in; I
didn't notice it in
my tests. The quick fix is to add the following
code to
matplotlib/backends/backend_gtk.py at line 773

        if GcfGTK.get_num_figwins()==0 and
ShowOn().is_mainloop_on():
            gtk.mainquit()

This is in the GcfGTK.destroy function, so the
entire function should
read

    def destroy(num):
        if not GcfBase.has_fignum(num): return
        figwin = GcfGTK.figs[num]
        figwin.figure.drawable= None
        GcfBase.destroy(num)
        if GcfGTK.get_num_figwins()==0 and
ShowOn().is_mainloop_on():
            gtk.mainquit()
    destroy = staticmethod(destroy)

This should restore the old functionality -- let me
know if you see
anymore strangeness. I'll check the change into
CVS.

[BTW, I posted the 0.30 announce to this mailing
list this afternoon,
but it didn't seem to make it. Hmmm.... Have I
been moderated out of
existence :slight_smile: ]

Thanks for the bug report,
John Hunter