[Rd] Size of graphics device assumed by package examples

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Dec 19 23:17:47 CET 2007

R CMD check currently runs the package examples on a landscape postscript 
device with a 12pt font.  This uses A4 or letter paper, and either 
is substantially larger than the canvases of the screen devices.

It seems reasonable to ask that the examples should work on standard 
screen devices.  The X11() and windows() devices default to nominally 7in 
square (although they may be smaller if the screen in use is small, and 
the windows() device allows for scrollbars).  All of these are with a 
(nominally) 12pt font, and that determines the size of the margins.

This suggests we should assume a maximum of 7in square when plotting 
examples.  Unfortunately that is not quite the whole story, as those 
nominal 12pt fonts differ in size and so the X11 device can have slightly 
different margins (larger or smaller) than the postscript() and pdf() 

Packages SLmisc, ade4 and yaImpute are pushing the limits, as for each an 
example will not plot on a 7x7 postscript or pdf device (nor several 
screen devices).

I suggest you test your examples on a 6in square device to be sure.  It is 
not realistic to expect to plot a 6 by 6 grid of scatterplots with 
individual axes on a screen device: even where the plot succeeds it is 

Also, please *view* the plots produced by R CMD check.  For example that 
for gplots shows a problem with an example (ooplot) setting a layout 
and failing to clear up afterwards.

BTW, at least for me the quartz device (the Mac OS X default) is rather 
different: both the default size and the default font are smaller but the 
net effect is even less space for examples.

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-devel mailing list