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

1. I added the following at the end of the script just before show

savefig("filename")

It works however the intereactive mode still comes up. How can I generate
the image file without having the interactive window come up.

2. figure(1, facecolor=figBG)
What is this used for? Is it for the interactive charting? I can still
generate charts to file with this commented.

3. Where and how do you set the overall size of the chart ( in inches or
pixels)

Thanks,

Vineet