import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-np.pi,np.pi,1000)
y = np.cos(x)
yy=1+y/2
plt.plot(x,y, 'b', label='y=cos(x)')
plt.plot(x,yy, 'r', label='y=1+0.5*cos(x)')
plt.legend(loc='lower center')
plt.savefig('cos_fig.png')
plt.show()
herrDeng網內搜尋
自訂搜尋
Ads
2021年5月6日 星期四
訂閱:
張貼留言 (Atom)
熱門文章
-
用 while loop 算 s=3*3+4*4+....88*88
-
計算你上學期加權平均
-
輸出字串20次
-
輸出課表代碼矩陣 Hint: 2-D array, double-for loop
-
統計第一作業 2, 3, 8, 9
-
Ex1 加權平均
-
data structure 期中考乙
-
請用格式化輸出排 9x9乘法表 hint: double-for, "%nd"

沒有留言:
張貼留言