The saving of movies is handled by the writer
objects in the animation
module and have nothing to do with the backend you set using use
. If you need to run your script without X then setting use('Agg')
is the correct thing to do.
See Generating movie from python without saving individual frames to files and the animation.writer
module attribute (which is a registry of the writers matplotlib found on your system).