Dear ones, I discovered Matplotlit only yesterday, and it's
> great. But I've got one problem. Since I am using the GTK
> backend, I have to use the show() function. But I have
> hundreds of figures and each to be written into a file. If I
> put the show() at the end of my program, the machine just
> can't handle it. If I put the show() in a loop, then I have
> close the hundreds of picture windows by hand. Is there a
> solution to this problem?
Yes, you want to use the Agg backend for bulk pure image generation.
You don't need to use show and no GUI pops up.
You can specify Agg from the command line by doing
> python myscript.py -dAgg
Or from within your script by doing
from matplotlib.matlab import *
Agg provides PNG output, which in my opinion is superior to jpeg for
These issues are covered in the FAQ, especially "Can I just generate
images without having a window popup?"
You should probably also check out