Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipython pandas plot does not show

Tags:

I am using the anaconda distribution of ipython/Qt console. I want to plot things inline so I type the following from the ipython console:

%pylab inline 

Next I type the tutorial at (http://pandas.pydata.org/pandas-docs/dev/visualization.html) into ipython...

import matplotlib.pyplot as plt import pandas as pd  ts = pd.Series(randn(1000), index = pd.date_range('1/1/2000', periods=1000)) ts = ts.cumsum() ts.plot() 

... and this is all that i get back:

<matplotlib.axes.AxesSubplot at 0x109253410> 

But there is no plot. What could be wrong? Is there another command that I need to supply? The tutorial suggests that that is all that I need to type.

like image 886
cantdutchthis Avatar asked Aug 22 '13 19:08

cantdutchthis


People also ask

Why is %Matplotlib inline?

Why matplotlib inline is used. You can use the magic function %matplotlib inline to enable the inline plotting, where the plots/graphs will be displayed just below the cell where your plotting commands are written. It provides interactivity with the backend in the frontends like the jupyter notebook.

How do you display plots in Jupyter notebook?

Usually, displaying plots involves using the show() function from PyPlot. With Jupyter notebooks, this isn't necessary as the plots are displayed after running the cells containing the code that generates them. These plots are by default, displayed inline, which means, they're displayed in the notebook itself.


1 Answers

Plots are not displayed until you run

plt.show()

like image 128
user792036 Avatar answered Nov 07 '22 15:11

user792036