Python绘制动画并保存为gif/mp4 (matplotlib)
animation.ArtistAnimation函数ani=animation.ArtistAnimation(fig,lns,interval=50)#生成动画ani.save("pendulum.gif",writer='pillow')ani.save('Pendulum_Animation.mp4',writer='ffmpeg',fps=1000/50)fig是用来展示的figure,用plt.figure()生成lns是list格式,每一个元素是一个完...