Stop gif image from repeating in matplotlib
问题 I searched for other similar questions but that didn't solve my problem. Below is a simple code that generates an animation in the form of a gif image in matplotlib: import numpy as np import matplotlib.pylab as plt import matplotlib.animation as anm fig = plt.figure() def draw(i): x = np.linspace(0, 5, num = 1000) y = np.sin(x-i*0.1) plt.clf() plt.plot(x, y, 'r-') anim = anm.FuncAnimation(fig, draw, frames = 10, interval = 500, repeat = False) anim.save('test.gif', fps = 1, writer =