Howdy, On Sat, Nov 7, 2009 at 12:30 PM, Darren Dale <dsdal...@gmail.com> wrote: > Me too. And thank you for posting the report and a workaround.
Quick question: would it be worth adding this monkeypatch to mpl proper? Right now, the qt4 backend is effectively unusable out of the box in distros like Karmic. Which is a bummer, because with the ipython sitting on my laptop, one can now load 'pylab' at any time during a session: maqroll[scratch]> ip Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) Type "copyright", "credits" or "license" for more information. IPython 0.11.bzr.r1219 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: import sys In [2]: 'matplotlib' in sys.modules Out[2]: False In [3]: %pylab wx Activating matplotlib with backend: WXAgg Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. Switching IPython gui support to: wx True In [4]: 'matplotlib' in sys.modules Out[4]: True In [5]: plot(sin(linspace(0,2*pi,200))) Out[5]: [<matplotlib.lines.Line2D object at 0xae0dccc>] This is starting to look very promising, but unfortunately: - right now we don't have gui switching support for Qt3 at all in ipython. Help is welcome, but I have no clue if it's easy/hard or even needed much anymore... - qt4 is unusable with the system's qt/pyqt... So perhaps a local patch would be worth it, no? I can confirm that with the attached patch, the new ipython support works: In [1]: %pylab qt Activating matplotlib with backend: Qt4Agg Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. In [2]: run simpleplot.py In [3]: close('all') In [4]: run simpleplot.py whereas before, I'd get the same nasty error mentioned above. The patch now has no run-time impact (I modified Pierre's code a bit so the check is done only once), but I'm not about to commit something in the Qt backend without someone else's eyes, especially Darren's :) Cheers, f
mpl_qt4.diff
Description: Binary data
------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel