【Python繁星点点】【KPoint006】-python交互模式下-sin()函数绘图

时间:2021-06-15 19:57:24

【工具要求】

安装anaconda包即可。

需要用的库:matplotlib和numpy

python交互模式下实现:

C:\Users\Administrator>python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:21:59) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy  as np
>>> import matplotlib.pyplot as plt
>>> x = np.arange(0,5,0.1);
>>> y = np.sin(x);
>>> plt.plot(x,y)
[<matplotlib.lines.Line2D object at 0x035E66B0>]
>>> plt.show()
>>> plt.show()
>>> plt.plot(x,y)
[<matplotlib.lines.Line2D object at 0x0B176DD0>]
>>> plt.show()
>>>

【Python繁星点点】【KPoint006】-python交互模式下-sin()函数绘图

【测试结果】

【Python繁星点点】【KPoint006】-python交互模式下-sin()函数绘图