Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 590
chrisfs Avatar asked May 09 '12 06:05

chrisfs


People also ask

How do you display plots in jupyter notebook?

IPython kernel of Jupyter notebook is able to display plots of code in input cells. It works seamlessly with matplotlib library. The inline option with the %matplotlib magic function renders the plot out cell even if show() function of plot object is not called.

Which is used to display plots on the jupyter notebook?

The %matplotlib magic command sets up your Jupyter Notebook for displaying plots with Matplotlib. The standard Matplotlib graphics backend is used by default, and your plots will be displayed in a separate window.


1 Answers

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.

like image 137
Tal Yarkoni Avatar answered Oct 12 '22 23:10

Tal Yarkoni