Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

python - Jupyter (IPython) notebook not plotting

I installed anaconda to use pandas and scipy. I reading and watching pandas tutorials and they all say to open the ipython notebook using

 ipython notebook --pylab==inline

but when I do that I get a message saying

"Support for specifying --pylab on the command line has been removed. Please use '%pylab = inline' or '%matplotlib =inline' in the notebook itself"

But that does not work. Then when I try "plot(arange(10))" I get a message saying "name 'plot' is not defined." I trying plotting data from a .csv file and got

"matplotlib.axes._subplots.AxesSubplot at 0xebf8b70".

What should I do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I believe the pylab magic was removed when they transitioned from IPython to a more general Jupyter notebook.

Try:

%matplotlib inline

Also when you get a message like:

"matplotlib.axes._subplots.AxesSubplot at 0xebf8b70".

That's just IPython displaying the object. You need to specify IPython display it. Hence the matplotlib inline magic.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...