I'd like to display some images while doing a numpy
computation:
import numpy as np
import matplotlib.pyplot as plt
plt.ion() # Turn the interactive mode on.
for i in range(100):
A = np.random.randn(10,10)
plt.imshow(A)
plt.pause(0.001)
# do some other numpy computations here (they take < 1 ms)
Instead of displaying the images quickly, it is rather slow.
I'm not asking for 100 frames per second, but I thought 30 fps would be possible, but it's not: after a few iterations, I'm close to 2 fps on my standard i5 laptop (Windows 7 x64).
How to have a faster imshow
refresh rate?
Notes:
I've already tried the main answer from Fast Live Plotting in Matplotlib / PyPlot, but here it seems a complex method (using
blit
parameter) for such a simple task and also I don't get 28 fps but only 15 fps.I only want to display the matrix as image: no border, no axes, no subplot, etc., I imagine this could be done faster than the solution Fast Live Plotting in Matplotlib / PyPlot, maybe not with matplotlib but another library?