I am trying to save a matplotlib animation but i always get a FileNotFoundError.
import matplotlib.animation as animation
anim = animation.FuncAnimation(fig, plot_update, frames = vel, init_func = plot_init, blit = True)
writervideo = animation.FFMpegFileWriter(fps = 60)
#I have also tried the FFMpegWriter class
anim.save("MaxvellDistribution.mp4", writer = writervideo)
I have tried making a empty file with the same name and type, hoping that it would overwrite or at least find the file, but no. Even if i have made a file it cant find it.
Any help would be greatly appreciated!
Tried a few different things, and apperantly you can make a gif file pretty easy. All the tutorials i have seen have used mp4, but that does not work for me. What i ended up with was this:
anim.save("MyFile.gif", fps = 60)
Here it will automaticly use pillow to save the animation as a gif. Still dont know why it does not work with mp4 (i have tried this method but replaced gif with mp4, does not work) but now at least there is an alternative.