[IPython-User] matplotlib integration without pylab
Mon Mar 12 10:35:11 CDT 2012
David Warde-Farley <firstname.lastname@example.org> writes:
> On Sun, Mar 11, 2012 at 04:46:35PM -0400, Nikolaus Rath wrote:
>> David Warde-Farley <email@example.com> writes:
>> > On 2012-03-11, at 1:43 PM, Nikolaus Rath wrote:
>> >> Hello,
>> >> Is there a way to get --pylab style matplotlib integration (i.e., no
>> >> need for blocking calls to matplotlib.pyplot.show() to display figures)
>> >> without any of the other effects that come with --pylab? In particular,
>> >> I do not want my namespace to be polluted with all the pylab commands.
>> > Use --gui=<backend>.
>> Have you tried that? It doesn't work here.
>> # ipython --gui=gtk
>> Python 2.7.2+ (default, Nov 30 2011, 19:22:03)
>> Type "copyright", "credits" or "license" for more information.
>> IPython 0.12 -- An enhanced Interactive Python.
>> In : from matplotlib import pyplot as plt
>> In : import numpy as np
>> In : plt.plot(np.arange(10), np.arange(10)**2)
>> Out: [<matplotlib.lines.Line2D at 0x2b28f90>]
>> [no windows shown ]
>> In : plt.show()
>> [window visible, call blocks]
> Calling pyplot.ion() before any of the other pyplot commands should do what
> you want -- at least it does here with --gui=qt.
That's what I was looking for! Thanks a lot!
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
More information about the IPython-User