How to run matplotlib in batch mode to generate plot image files

Thanks for the information. It has been very

    > helpful. Matplotlib seems to be ignoring the use
    > command. When I change the value in .matplotlibrc it works
    > however adding the use('Agg') does not change the
    > backed. Do I need to do anything else?

You must use the use command before importing matplotlib.matlab, as
described on

  >>> import matplotlib
  >>> matplotlib.use('Agg')
  >>> from matplotlib.matlab import *

Note that if you are using an IDE like pycrust, pythonwin, or IDLE,
matplotlib.matlab may have already been loaded, and subsequent calls
to use or 'from matplotlib.matlab import *' will have no effect unless
you explicitly force a module reload.