Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- import matplotlib.animation as animation
- import time
- n=100
- x = np.linspace(0, 99, num=100)
- y = np.linspace(0, 99, num=100)
- X,Y = np.meshgrid(x, y)
- fig = plt.figure()
- ax1 = fig.add_subplot(1,1,1)
- def animate(i):
- Temp_matrix=np.empty(shape=[0,n])
- file = open('Temperature.txt', 'r')
- for i in range (1,n+1):
- line = file.readline().strip().split()
- line=np.float32(line)
- Temp_matrix=np.append(Temp_matrix,[line],axis=0)
- fig.clear()
- CS = plt.contourf(X,Y,Temp_matrix,9)
- colorb=plt.colorbar(CS)
- plt.title('Placa 1x1')
- ani = animation.FuncAnimation(fig, animate, interval=1000)
- plt.show()
- call flush(valores)
Add Comment
Please, Sign In to add comment