I have some trouble to animate a 2D Array:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
arr=[]
for i in range(
Oh thanks, it was easyer then I expected.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
i=0
im = plt.imshow(arr[0], animated=True)
def updatefig(*args):
global i
if (i<99):
i += 1
else:
i=0
im.set_array(arr[i])
return im,
ani = animation.FuncAnimation(fig, updatefig, blit=True)
plt.show()