[IPython-dev] New GUI integration in IPython

Brian Granger ellisonbg.net@gmail....
Tue Sep 8 11:46:56 CDT 2009


> In the following test, when I issue a plt.show() I can't get access to the
> IPython shell unless I close the plot window. Moreover If I call plt.show()
> without a plot command beforehand, I have to kill the shell and restart the
> session again.
>
> Seems like a bug or something getting wrong with my system.
>
> This is Fedora 11.
>
>
Can you retry with using

%gui -a qt

The -a flag tells IPython to create an application object, and then show
should work as expected.

Again, this is an issue with the event loop hacks that matplotlib currently
does.  The current show function in matplotlib looks to see if an qt app has
been created, if not, they create one and start the event loop (which
blocks).  This used to work because IPython used to monkey patch the
wx/qt/gtk event loops to be no-ops.  These hacks are based on the older
threading approach and once matplotlib updates their code, all of this will
"just work."

Could you bring these issues up on the matplotlib list?

Cheers,

Brian


> $ ipython
>
> Python 2.6 (r26:66714, Jun  8 2009, 16:07:26)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.11.bzr.r1205 -- An enhanced Interactive Python.
>
> I[1]: import matplotlib.pyplot as plt
>
> I[2]: %gui qt
>
> I[3]: plt.plot(range(10))
> O[3]: [<matplotlib.lines.Line2D object at 0xacc386c>]
>
> I[4]: plt.show()
>
>
> --
> Gökhan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20090908/5c40cfdb/attachment.html 


More information about the IPython-dev mailing list