figure dpi output problem

I'm trying to get matplotlib to make a 600x300 png, but matplotlib won't
let me; it keeps making a 612x312 png instead. Here's a sample script
that has the problem on my system:

figure(figsize=(6., 3.))
plot(arange(10))
savefig('test.png', dpi=100.)

If I set dpi to 50., it makes a 312x162 png. It appears to be adding a 6
pixel border to the edge of all the pngs. How do I get rid of it?

Windows XP SP2, Python 2.5, matplotlib 0.90.

Jordan

jdawe@...128... wrote:

I'm trying to get matplotlib to make a 600x300 png, but matplotlib won't
let me; it keeps making a 612x312 png instead. Here's a sample script
that has the problem on my system:

figure(figsize=(6., 3.))
plot(arange(10))
savefig('test.png', dpi=100.)

If I set dpi to 50., it makes a 312x162 png. It appears to be adding a 6
pixel border to the edge of all the pngs. How do I get rid of it?

Windows XP SP2, Python 2.5, matplotlib 0.90.

Jordan

I get a 600x300 png with that script, using the latest SVN.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328

Jeff Whitaker wrote:

···

jdawe@...128... wrote:

I'm trying to get matplotlib to make a 600x300 png, but matplotlib won't
let me; it keeps making a 612x312 png instead. Here's a sample script
that has the problem on my system:

figure(figsize=(6., 3.))
plot(arange(10))
savefig('test.png', dpi=100.)

If I set dpi to 50., it makes a 312x162 png. It appears to be adding a 6
pixel border to the edge of all the pngs. How do I get rid of it?

Windows XP SP2, Python 2.5, matplotlib 0.90.

Jordan

I get a 600x300 png with that script, using the latest SVN.

-Jeff

Me too, on Linux, mpl 0.90dev3131. If it's adding a constant border of 6 on two
sides, can you tell mpl to export e.g. 588x288 (more hack than solution, though...)?

--
cheers,
steve

I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams

Hi,

2007/5/26, Steve Schmerler <elcorto@...361...>:

Jeff Whitaker wrote:

[cut]

> I get a 600x300 png with that script, using the latest SVN.
>
> -Jeff
>

Me too, on Linux, mpl 0.90dev3131.

Me too with MPL 0.87.7 on Debian Etch.

    ~ Antonio

···

> jdawe@...128... wrote: