It is not advisable to use pylab
mode. See the following post from Matthias Bussonnier
A summary from that post:
Why not to use pylab
flag:
- It is irreversible- Cannot unimport
- Unclear- if someone else did not run with this flag (or with a different setting of it) what would happen?
- Pollutes the namespace
- Replaces built-ins
- Side effects
You are much better by doing the following inside your IPython notebook.
%matplotlib inline import matplotlib.pyplot as plt plt.plot(range(10))
The following is the code which --pylab
brings into the namespace
import numpy import matplotlib from matplotlib import pylab, mlab, pyplot np = numpy plt = pyplot from IPython.core.pylabtools import figsize, getfigs from pylab import * from numpy import *
Still, if you wish to use pylab
and have plots inline, you may do either of the following:
From shell:
$ ipython notebook --pylab inline
Or, from within your notebook
%pylab inline