python绘图

安装好matplotlib和numpy后就可以直接在idle上写代码画图了

>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> n=np.linspace(0,25,125)
>>> y2=2*n
>>> plt.figure()
<Figure size 640x480 with 0 Axes>
>>> plt.plot(n,y1)
[<matplotlib.lines.Line2D object at 0x01749850>]
>>> plt.ylabel('some numbers')
Text(0, 0.5, 'some numbers')
>>> plt.show()

参考了https://morvanzhou.github.io/tutorials/

python绘图