[R] graphics

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Oct 12 12:38:23 CEST 2008


On Sun, 12 Oct 2008, Jim Lemon wrote:

> Darja Poklukar wrote:
>> I just want to ask how to enlarge the resolution of my plots in R. For ex. 
>> for publising I would like a picture of resolution minimal 500 dpi, all I 
>> managed was picture of dim 5,28 X 5,83 with 118 pixels/cm.
>>
>> 
> Hi Darja,

> The usual answer is to increase the size of the image. For example, if you 
> are using the one of the bitmapped devices, the default resolution is 480x480 
> pixels.

That is a size, not a resolution.

> If you now have 118 pixels/cm (300 dpi) and you were using the 
> default resolution, by specifying 800x800 pixels, you should get the desired 
> output resolution when the image is scaled to your output size.

That will result in very small text and hence small margins.

The documented approach is to set the res= argument, and use something 
like

png(width=10, height=10, units="cm", res=600)

(That's for current R, but the posting guide asks you to mention that, 
*and* to update before posting.)

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list