Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. fig, (ax1,ax2) = plt.subplots(2,sharex=True)
  2. def animate(t):
  3. x = np.linspace(0,1)
  4. ax1.clear()
  5. ax1.plot(x,np.cos(x-t))
  6. ax2.clear()
  7. ax2.plot(x,np.cos(x-2*t))
  8.  
  9. ani = animation.FuncAnimation(fig,animate,np.linspace(0,1),interval=50)
  10. #ani.save("test.mp4")
  11. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement