Matplotlib - Animations
What will be the output of this code snippet?
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
line, = ax.plot([], [], 'r-')
def update(frame):
x = list(range(frame))
y = [i**2 for i in x]
line.set_data(x, y)
return line,
ani = animation.FuncAnimation(fig, update, frames=5, repeat=False)
plt.show()