Advertisement
Guest User

Untitled

a guest
Feb 29th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. #! /usr/bin/python
  2.  
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. import matplotlib.animation as anim
  6.  
  7. x = np.arange(0, 4*np.pi, 0.1)
  8. fig = plt.figure()
  9. line, = plt.plot(x, np.sin(x))
  10.  
  11. def update_figure(n):
  12.     line.set_ydata(np.sin(n)*np.sin(x))
  13.  
  14. line_anim = anim.FuncAnimation(fig, update_figure, np.arange(0, 2*np.pi, 0.1), interval=50)
  15. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement