Re: [R] Graphics device size

From: Christos Hatzis <>
Date: Wed 12 Apr 2006 - 06:23:32 EST

Actually it does.
Thank you, Prof. Ripley.

-----Original Message-----
From: Prof Brian Ripley [] Sent: Tuesday, April 11, 2006 1:26 PM
To: Christos Hatzis
Subject: Re: [R] Graphics device size

On Tue, 11 Apr 2006, Prof Brian Ripley wrote:

> On Tue, 11 Apr 2006, Christos Hatzis wrote:
>> Dear All,
>> When working with composite plots many times I have to manually
>> adjust the graphics display window size to get the best results (in
>> Windows XP). I can then find the size of the adjusted window in inches
using par("din").
>> Now I would like to export the adjusted graphs as png's and have them
>> look as close to the original display as possible. The problem is
>> that the png device accepts size arguments in pixels so that I need
>> to convert inches to pixels. Is there a way to get the default
>> pixels-per-inch that the windows device uses? RSiteSearch("ppi") did not
return any helpful hints.
> Well, yes, but only by calling the Win API for your own C code. It is
> often not very accurate. Interestingly, it is actually in pixels per cm.
> What is harder is to do is to find out how large you have resized the
> graphics window to. Since in fact that is stored in pixels, you don't
> need the pixels-per-inch, but I can see no way to do this without C
> code (the info is both in the private structure defined in
> devWindows.h and in the device-driver structure via right - left, bottom -

Doesn't savePlot(, type="png") do everything that you might want here?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Wed Apr 12 06:54:51 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 12 Apr 2006 - 08:09:38 EST.

Mailing list information is available at Please read the posting guide before posting to the list.