November 2018
Beginner to intermediate
214 pages
5h 2m
English
To disable the ability of the animation, set repeat to False, as shown in the following code:
# Repeat, pause after final framenums = np.arange(0,10,0.1)sin, = plt.plot(nums, np.sin(nums))frames=np.arange(0,2*np.pi,0.1)def update(i): sin.set_ydata(np.sin(nums+i))FuncAnimation(plt.gcf(), update, frames=frames, interval=50, repeat_delay=2e3)
By setting repeat to False, we get to loop through the frames array. Then, the animation will halt:

To pause the repetition of the animation, use the repeat_delay argument. By using this argument (repeat_delay=2e3), we can see that it will ...
Read now
Unlock full access