sin and cos函數曲線
import numpy as np
import math
import matplotlib.pyplot as plt
#sin and cos curves
x=np.arange(0,6,0.1)
y1=np.sin(x)
y2=np.cos(x)
plt.plot(x,y1,label='sin')
plt.plot(x,y2,label='cos',linestyle='--')
plt.xlabel('x')
plt.ylabel('y')
plt.title('sin & cos') #print title
plt.legend() #print curve style
plt.show()
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!