Menu
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
def init():
data = np.zeros((100, 100))
ax.imshow(data, cmap='gray')
return ax
def update(frame):
data = np.sin(frame / 10.0)
ax.imshow(data, cmap='gray')
return ax
ani = animation.FuncAnimation(fig, update, frames=100, init_func=init, blit=True)
plt.show()