[IPython-User] matplotlib integration without pylab
Mon Mar 12 10:00:50 CDT 2012
On Sun, Mar 11, 2012 at 04:46:35PM -0400, Nikolaus Rath wrote:
> David Warde-Farley <firstname.lastname@example.org> 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.
More information about the IPython-User