in Ipython notebook / Jupyter, Pandas is not displaying the graph I try to plot

chrisfs picture chrisfs · May 9, 2012 · Viewed 79.9k times · Source

I am trying to plot some data using pandas in Ipython Notebook, and while it gives me the object, it doesn't actually plot the graph itself. So it looks like this:

In [7]:

pledge.Amount.plot()

Out[7]:

<matplotlib.axes.AxesSubplot at 0x9397c6c>

The graph should follow after that, but it simply doesn't appear. I have imported matplotlib, so that's not the problem. Is there any other module I need to import?

Answer

Tal Yarkoni picture Tal Yarkoni · May 28, 2014

Note that --pylab is deprecated and has been removed from newer builds of IPython, The recommended way to enable inline plotting in the IPython Notebook is now to run:

%matplotlib inline
import matplotlib.pyplot as plt

See this post from the ipython-dev mailing list for more details.