I am simulating spring-mass system. This is the code.
fig, ax = plt.subplots() ax.set(xlim=(-5.1, 5.1), ylim=(-0.05,1)) # ax.grid() def animate(i): l1.se