I want to save matplotlib animation in gif format.
I succeded to save animation to mp4 format, using code
import matplotlib
matplotlib.use(\"Agg\")
Still had some trouble on Mac OS X, but the answers above pointed me in the right direction.
What I did came down to:
changed the settings of matplotlibrc as described above. You can find the location of matplotlibrc by doing in Python: import matplotlib matplotlib.matplotlib_fname()
The settings you need to adjust can be found at the end of the file. I adjusted the following ones (commented out). Please note that those settings are not in 'quotes':
animation.writer : imagemagick
animation.codec : mpeg4
animation.bitrate: -1
animation.frame_format: png
animation.convert_path: convert