美文网首页
jupyter notebook画图

jupyter notebook画图

作者: running_sheep | 来源:发表于2019-07-25 14:23 被阅读0次

1.进入工作目录,打开cmd,输入jupyter notebook

2.画图的时候增加%matplotlib inline,使得图显示在notebook中

如:

import matplotlib.pyplot as plt

import numpy as np

%matplotlib inline

X=np.linspace(-np.pi,np.pi,256,endpoint=True)#-π to+π的256个值

C,S=np.cos(X),np.sin(X)

plt.plot(X,C)

plt.plot(X,S)

plt.show()

相关文章

网友评论

      本文标题:jupyter notebook画图

      本文链接:https://www.haomeiwen.com/subject/mwlhrctx.html