[R] Resolution of plots

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jun 18 18:27:24 CEST 2004

On Thu, 17 Jun 2004, Thomas Lumley wrote:

> On Wed, 16 Jun 2004, Prof Brian Ripley wrote:
> > You will have to tell us more.  Exporting how: to what format using what
> > device and what exact command on what operating system?
> >
> > The only device I know of that even knows about dpi is bitmap() and that
> > has no such limit unless imposed by your implementation of ghostscript.
> There is an issue with PNG. libpng provides png_set_pHYs to set resolution
> (in pixels/metre) but provides a default if it is not set.  We don't set
> it, and so get the default resolution.

That seems not to be quite correct.  First, the pHYs chunk is optional in
PNG files.  If present, what is recorded in the file is the units,


plus two numbers (x and y res).  Reading applications are allowed to treat
missing pHYs data or numbers 0 as they like, and for example PhotoShop and
GIMP display both as 72 dpi.

So I think what we are doing is entirely within the spec.  I am in the 
process of adding an arg to allow this to be set (with square pixels, all 
R supports).

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