Matplotlib - Animations
Identify the error in this animation code snippet:
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
line, = ax.plot([], [])
def update(frame):
x = range(frame)
y = [i*2 for i in x]
line.set_data(x, y)
ani = animation.FuncAnimation(fig, update, frames=10, blit=True)
plt.show()