原文地址:https://www.cnblogs.com/liqinglucky/p/fourier.html
import matplotlib.pyplot as plt import numpy as np t = np.arange(-2*np.pi, 2*np.pi, 0.01) s =(4*np.sin(t))/(np.pi)+(4* np.sin(3*t))/(3*np.pi) plt.plot(t, s) plt.xlabel('time (s)') plt.ylabel('voltage (mV)') plt.title('About as simple as it gets, folks') plt.grid(True) plt.savefig("test.png") plt.show()
标签:plt,作图,sin,np,import,pi,傅里叶,展开 From: https://www.cnblogs.com/liqinglucky/p/fourier.html