Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scipy.optimize as opt
- import numpy as np
- import matplotlib.pyplot as plt
- Fs = 8000
- f = 3
- sample = 8000
- x = np.arange(sample)
- y = np.sin(2 * np.pi * f * x / Fs)
- y1 = 0.5*np.sin((2 * np.pi * f * x / Fs)+(np.pi/2))
- y2 = 0*x + 0
- plt.plot(x, y)
- plt.plot(x, y1)
- plt.plot(x, y2, '#000000')
- plt.xlabel('sample(n)')
- plt.ylabel('voltage(V)')
- ax=plt.subplot()
- ax.spines['top'].set_visible(False)
- ax.spines['right'].set_visible(False)
- ax.axes.xaxis.set_visible(False)
- ax.axes.yaxis.set_visible(False)
- #plt.title('test')
- plt.xlabel('Test', labelpad=10)
- plt.ylabel('Test', labelpad=10)
- #plt.text(1, -7,'matplotlib', horizontalalignment='left',verticalalignment='center')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement