使用Matplotlib生成正弦曲线
发布时间
阅读量:
阅读量
import numpy as np
import matplotlib.pyplot as plt
# 在 [0, 4*PI] 之间取 100 个点
x = np.linspace(0, 4 * np.pi, num=50)
# 计算这 50个点的正弦值,并保存在变量 y
y = np.sin(x)
# 画出 x, y 即是我们的正弦曲线
plt.plot(x, y)
AI写代码python
运行

全部评论 (0)
还没有任何评论哟~
