How to make IPython notebook matplotlib plot inline

后端 未结 10 2170
轮回少年
轮回少年 2020-11-22 14:37

I am trying to use IPython notebook on MacOS X with Python 2.7.2 and IPython 1.1.0.

I cannot get matplotlib graphics to show up inline.

import matplo         


        
相关标签:
10条回答
  • 2020-11-22 15:11

    I have to agree with foobarbecue (I don't have enough recs to be able to simply insert a comment under his post):

    It's now recommended that python notebook isn't started wit the argument --pylab, and according to Fernando Perez (creator of ipythonnb) %matplotlib inline should be the initial notebook command.

    See here: http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Part%203%20-%20Plotting%20with%20Matplotlib.ipynb

    0 讨论(0)
  • 2020-11-22 15:13

    Ctrl + Enter

    %matplotlib inline
    

    Magic Line :D

    See: Plotting with Matplotlib.

    0 讨论(0)
  • 2020-11-22 15:14

    I did the anaconda install but matplotlib is not plotting

    It starts plotting when i did this

    import matplotlib
    import numpy as np
    import matplotlib.pyplot as plt
    %matplotlib inline  
    
    0 讨论(0)
  • 2020-11-22 15:20

    I found a workaround that is quite satisfactory. I installed Anaconda Python and this now works out of the box for me.

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