import matplotlib.pyplot as plt import math A = 3.0 OMEGA = 2*math.pi/0.75 x1 = [x*0.02 for x in range(1,100)] sinc = [math.sin(OMEGA*x)/(OMEGA*x) for x in x1] x2 = [x*0.01 for x in range(0,200)] normalsin = [A*math.sin(OMEGA*x) for x in x2] plt.figure() plt.subplot(2,1,1) plt.ylabel("Damped oscillation") plt.plot(x1, sinc, 'r.') plt.plot(x1, sinc, 'k--') plt.ylim((-1.0,1.0)) plt.grid(color='k', linestyle=':', linewidth=1) plt.title("The world of oscillations") plt.subplot(2,1,2) plt.grid(color='k', linestyle=':', linewidth=1) plt.ylabel("Undamped") plt.xlabel("Time (s)") plt.plot(x2, normalsin, 'g') plt.show()