I have an animation created with plt.pause
as below...
import matplotlib.pyplot as plt
for i in range(10):
plt.scatter(0, i)
plt.pause(0.01)
plt.show()
How can I save this as a video file, e.g. a .mp4 file?
CodePudding user response:
First, I have to redefine the plotting as a function with the plotted point given by a frame i
. plt.pause()
can be replaced by matplotlib.animate
. Finally, I used a package suggested