I have a set of .txt
named "occupancyGrid_i"
, i
being a number from 0-100
.
What I'd like to do is to open every one of them and show them for 3 seconds. The data of the .txt
is a [N x M] matrix
.
import numpy
import matplotlib.pyplot as plt
import time
while True:
matrix = numpy.loadtxt('res/matrix_' + str(i) + '.txt')
plt.clf()
plt.imshow(matrix)
plt.show()
time.sleep(3)
i=i+1
What I have done so far doesn't seem to be enough. What am I doing wrong?