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
import matplotlib
matplotlib.use('Agg')
from matplotlib.matlab import *
plot([1,2,3])
savefig('myfile')
Agg provides PNG output, which in my opinion is superior to jpeg for
line art.
These issues are covered in the FAQ, especially "Can I just generate
images without having a window popup?"
http://matplotlib.sourceforge.net/faq.html
You should probably also check out
http://matplotlib.sourceforge.net/tutorial.html
and
http://matplotlib.sourceforge.net/backends.html
Good luck!
JDH