Guest User

Untitled

a guest
Jan 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import matplotlib.animation as animation
  4. import time
  5.  
  6. n=100
  7. x = np.linspace(0, 99, num=100)
  8. y = np.linspace(0, 99, num=100)
  9. X,Y = np.meshgrid(x, y)
  10.  
  11. fig = plt.figure()
  12. ax1 = fig.add_subplot(1,1,1)
  13.  
  14. def animate(i):
  15. Temp_matrix=np.empty(shape=[0,n])
  16. file = open('Temperature.txt', 'r')
  17. for i in range (1,n+1):
  18. line = file.readline().strip().split()
  19. line=np.float32(line)
  20. Temp_matrix=np.append(Temp_matrix,[line],axis=0)
  21. fig.clear()
  22. CS = plt.contourf(X,Y,Temp_matrix,9)
  23. colorb=plt.colorbar(CS)
  24.  
  25. plt.title('Placa 1x1')
  26.  
  27. ani = animation.FuncAnimation(fig, animate, interval=1000)
  28. plt.show()
  29.  
  30. call flush(valores)
Add Comment
Please, Sign In to add comment