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

后端 未结 7 2076
梦谈多话
梦谈多话 2020-12-22 18:27

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:

相关标签:
7条回答
  • 2020-12-22 19:06

    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.

    0 讨论(0)
  • 2020-12-22 19:09

    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.

    0 讨论(0)
  • 2020-12-22 19:13

    All you need to do is to import matplotlib.

    import matplotlib.pyplot as plt 
    
    0 讨论(0)
  • 2020-12-22 19:20
    import matplotlib as plt
    %matplotlib as inline
    
    0 讨论(0)
  • 2020-12-22 19:23

    With your import matplotlib.pyplot as plt just add

    plt.show()
    

    and it will show all stored plots.

    0 讨论(0)
  • 2020-12-22 19:23

    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

    0 讨论(0)
提交回复
热议问题