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

PythonPandasIpythonJupyter Notebook

Python Problem Overview


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?

Python Solutions


Solution 1 - Python

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.

Solution 2 - Python

Edit:Pylab has been deprecated please see the current accepted answer

Ok, It seems the answer is to start ipython notebook with --pylab=inline. so ipython notebook --pylab=inline This has it do what I saw earlier and what I wanted it to do. Sorry about the vague original question.

Solution 3 - Python

With your import matplotlib.pyplot as plt just add

plt.show()

and it will show all stored plots.

Solution 4 - Python

simple after importing the matplotlib you have execute one magic if you have started the ipython as like this

ipython notebook 

%matplotlib inline 

run this command everything will be shown perfectly

Solution 5 - Python

start ipython with ipython notebook --pylab inline ,then graph will show inline.

Solution 6 - Python

import matplotlib as plt
%matplotlib as inline

Solution 7 - Python

All you need to do is to import matplotlib.

import matplotlib.pyplot as plt 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionchrisfsView Question on Stackoverflow
Solution 1 - PythonTal YarkoniView Answer on Stackoverflow
Solution 2 - PythonchrisfsView Answer on Stackoverflow
Solution 3 - PythoneumiroView Answer on Stackoverflow
Solution 4 - PythonAnkannaView Answer on Stackoverflow
Solution 5 - PythonpigletflyView Answer on Stackoverflow
Solution 6 - PythonTrilochanYadavView Answer on Stackoverflow
Solution 7 - Pythonthe curious mindView Answer on Stackoverflow