How to make IPython notebook matplotlib plot inline

后端 未结 10 2173
轮回少年
轮回少年 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:10

    If your matplotlib version is above 1.4, it is also possible to use

    IPython 3.x and above

    %matplotlib notebook
    
    import matplotlib.pyplot as plt
    

    older versions

    %matplotlib nbagg
    
    import matplotlib.pyplot as plt
    

    Both will activate the nbagg backend, which enables interactivity.

提交回复
热议问题