1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import os import matplotlib.pyplot as plt import numpy as np os.chdir('/home/vg/Downloads/projects/ex5') os.getcwd() N = [4,8,16,64] plt.figure(figsize=(20,10)) for i,n in enumerate(N): #subplot(2,2,i+1) fig = plt.subplot(2,2,i+1) plt.stem(np.arange(n),np.hamming(n)) plt.xticks(arange(0,n+1,n/4)) plt.yticks([0,0.5,1]) plt.xlim(-0.5,n+0.5) plt.title('N=%d' % n) plt.savefig("example5.png", dpi=300) plt.show() plt.close() <img class=" wp-image-51 aligncenter" src="https://gantovnik.com/bio-tips/wp-content/uploads/2018/12/example5-2.png" alt="example5" width="468" height="374" /> |
Recent Comments