I'm trying to animate a numpy array using matplotlib:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
arr = []
for i in range(100):
c = np.random.rand(10, 10)
arr.append(c)
plt.imshow(arr[45])
I don't get it how I should animate an array like this: https://matplotlib.org/examples/animation/dynamic_image.html
FuncAnimationprovided with a callback function to update the plot you made.FuncAnimation()knows, what to update. Then you need an update function that tellsmatplotlib, what to do with the figure. Is it a jump to the left and then a step to the right? We don't know, but the script should.