Is it possible to output sequence of files in vector format through matplotlib animation module?
For example:
...
anim = animation.FuncAnimation(...)
anim.save('animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])
outputs mp4 movie (through ffmpeg).
Can I instruct animation class to output sequence of vector files?
To see what writers are available on your system use:
import matplotlib.animation as animation
print animation.writers.list()
You might need to write a new writer
for what you want.
Edit
"FileWriters" from Matplotlib animation module seem to support only raster output. For FFMpegFileWriter()
that's clear from documentation, and for FileMovieWriter()
it can be derived if we initiate this class with unsupported format:
plt.rcParams['animation.frame_format'] = 'svg'
in which case Error is raised printing supported formats:
Unrecognized animation.frame_format string "'svg'": valid strings are ['rgba', 'tiff', 'jpeg', 'png', 'raw']
So Matplotlib animation module seems to work only with raster data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With