hanslovsky

plot sine

Sep 27th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. y = np.linspace(0,1,1000)
  5. x1 = np.sin( 2.5*np.pi*y - 0.3 )
  6. x2 = -x1
  7.  
  8. fig = plt.figure(figsize=[3,6])
  9. ax1 = fig.add_subplot(111)
  10. ax1.grid(b=False)
  11. plt.axis('off')
  12.  
  13. plt.xlim( [-1.2,1.2] )
  14.  
  15. plt.plot( x1, y, color='b' )
  16. plt.plot( x2, y, color='b' )
  17.  
  18. plt.savefig("test.png",bbox_inches='tight',transparent=True)
  19. # plt.show()
Advertisement
Add Comment
Please, Sign In to add comment