Guest User

Untitled

a guest
Jan 16th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. I want to see the effect of a continuous drawing, with the following code(in python3):
  2. fg = plt.figure()
  3. ax = fg.add_subplot(1,1,1)
  4. plt.ion()
  5. for d in range(3):
  6. x_data = np.array([])
  7. y_data = np.array([])
  8. #plt.clf()
  9. for t in range(v):
  10. x = t
  11. x_data = np.append(x_data,x)
  12. y = t*d
  13. y_data = np.append(y_data,y)
  14. #ax.lines = ax.plot(x_data,y_data)
  15. plt.plot(x_data,y_data)
  16. #plt.show()
  17. #plt.pause(0.3)
  18. time.sleep(0.3)
  19. plt.show()
  20. plt.close('all')
Add Comment
Please, Sign In to add comment