import matplotlib.pyplot as plt
from numpy import *
plt.figure(figsize = (8,4))
x_values = arange(0.0,math.pi * 4,0.01)
y_values = sin(x_values)
plt.plot(x_values, y_values, 'b--', label='$sin(x)$', linewidth=1.0)
plt.xlabel('x')
plt.ylabel('sin(x)')
plt.ylim(-1,1)
plt.title('Simple plot')
plt.legend()
plt.grid(True)
plt.savefig("sin.png")
plt.show()
Spyder绘制函数曲线图
最新推荐文章于 2024-06-07 20:06:35 发布