Advertisement
WhoIsAbishag

marco.py

Apr 26th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import matplotlib.animation as animation
  3. import time
  4.  
  5.  
  6. fig = plt.figure()
  7. ax1 = fig.add_subplot(1,1,1)
  8.  
  9. def animate(i):
  10. pullData = open('sampleData.txt','r').read()
  11. dataArray = pullData.split('\n')
  12. xar=[]
  13. yar=[]
  14. for eachLine in Data:
  15. if len(eachLine)>1:
  16. x,y = eachLine.split(',')
  17. xar.append(int(x))
  18. yar.append(int(x))
  19.  
  20.  
  21. ax1.plot(xar,yar)
  22.  
  23. ani = animation.FuncAnimation(fig,animate, interval=1000)
  24. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement