[SciPy-user] How to give a name to a figure?

Nuttall, Brandon C bnuttall@uky....
Mon Sep 15 11:28:35 CDT 2008


Mathieu,

Its pretty easy. The statements below do what you I want:

(of course, you have to import pylab)

>>> path = 'c:\\documents and settings\\bnuttall\\desktop\\adair\\'
>>> picfile = '%sR%s.png' % (path,str(wellid).rjust(7,'0'))

...snip... (a bunch of statements constructing the figure)

>>> pylab.savefig(picfile)

In my case, the wellid is a serial integer that uniquely identifies the data set. I have coded similar statements to alter the path name systematically so that related output gets grouped in folders.

Brandon Nuttall

-----Original Message-----
From: scipy-user-bounces@scipy.org [mailto:scipy-user-bounces@scipy.org] On Behalf Of Mathieu Dubois
Sent: Monday, September 15, 2008 12:14 PM
To: scipy-user@scipy.org
Subject: [SciPy-user] How to give a name to a figure?

Hi,

I'm a beginner in scipy and I have a small problem with figures. Let me
explain.

I have to plot complicated data so I have a lot of figures. I have set
title and axes names.

My problem is that the windows are titled with things like 'Figure 1',
'Figure 2' etc. Is it possible to set this name to something more
understable? Apparently title() changes the name of the plots inside the
figure.

My goal is to save (with savefig()) them with a nice name say
'title.png' (where title would be replaced by the title of my figure).

Any help would be appreciated.

Thanks in advance,
Mathieu
_______________________________________________
SciPy-user mailing list
SciPy-user@scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-user mailing list