. Newbie. Interactive and saving plots to file

Just started using matplotlib (it’s
great!) interactively (using ipython, TkAgg backend) and am moving into
saving plots to file.

I edited the matplotlibrc to interactive:
False and backend: Agg, and it works great. (produces .png)

I would normally like to muck around
interactively to get the plot right, then save it to png once I’m happy
with it.

The question is, do people wanting to
do this have to edit the matplotlibrc and restart Python each time, or
is there some other way?

editorial: What a great combination
is Python and matplotlib!

Thanks.

UNITED GROUP

This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.

If you have received this email in error, please notify United Group immediately by email to the sender’s email address and delete this document.

brett.mcsweeney@...1537... ha scritto:

The question is, do people wanting to do this have to edit the matplotlibrc and restart Python each time, or is there some other way?

Try to look for savefig()

m.

···

--
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
massimo.sandal@...898...

tel: +39-051-2094388
fax: +39-051-2094387

no need. as the name implies, TKagg is already using agg internally, so you can just use pylab.savefig (or better yet, figure.savefig), and get the same high quality PNG. No need to switch back-ends. The plain Agg back-end is there for things like web apps, where you may not be able to run a GUI at all.

-Chris

···

brett.mcsweeney@...1537... wrote:

I edited the matplotlibrc to interactive: False and backend: Agg, and it works great. (produces .png)

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...