Must PNG of plot *always* be 800x600 pixels?

Is there an easy way to stretch/shrink dimensions of PNG
generated by savefig to ANYTHING you want in addition
to 800 x 600 pixels?

e.g. can you make 704 x 1107?
                  120 x 1020?
           4008 x 3653?

Chris

Christian Seberino wrote:

Is there an easy way to stretch/shrink dimensions of PNG
generated by savefig to ANYTHING you want in addition
to 800 x 600 pixels?

Yes:

http://www.scipy.org/wikis/topical_software/AdjustingImageSize

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

You can scale the PNG by setting the dpi keyword argument in savefig.
You can also adjust the size of a plot using the set_figsize_inches
method of the figure:

In [31]: t=arange(0,1,0.01)

In [32]: y=sin(2*pi*t)

In [33]: temp=figure(1)

In [34]: temp.set_figsize_inches((2,10),forward=True)

In [35]: plot(t,y)
Out[35]: [<matplotlib.lines.Line2D instance at 0xb4a9196c>]

In [36]: savefig('test.png',dpi=50)

In [37]:

···

On 1/9/06, Christian Seberino <seberino@...391...> wrote:

Is there an easy way to stretch/shrink dimensions of PNG
generated by savefig to ANYTHING you want in addition
to 800 x 600 pixels?

e.g. can you make 704 x 1107?
                  120 x 1020?
                 4008 x 3653?

Chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iQEVAwUAQ8Kh8MXAD6FzhZH3AQKESgf/TgzuvMobvVPcXqf6R3fLjtZxBB2q8qRV
yMOMn5KSw4+R/t0ZOJ/hCB89ZJ+7gNbJtMHIu+HRdVKZvVv6Z0Aww5jjKrOaHocP
d7LmqemMYmbaxfPrDnDo79Idyg1XCSNNkI5kml06633f5HqpvQ8rE7XlVNn+DtJY
b25fSA2gLRukI92BSBozCbDadXmejFBd9aAG13JcxuOLwLp7ZqDbNib7KU9u6SpN
I7xIZaNceHMWwbRqR0Op4MSRIMeAovDOjEq1kGI6piCR0mmge8ARGXwxRDxy5WZ4
4Z86sqG89w4nGo6r2mKwbNsvwI2xkoscECN7JttZfjZlKpnoy0t8pA==
=/rpn
-----END PGP SIGNATURE-----