[R] Using split.screen

Anon. bob.ohara at helsinki.fi
Thu Jan 8 15:58:57 CET 2004


I want to draw a figure with several panels of unequal size, so i 
thought I would try using screen().  However, I can't figure out how to 
define the sizes as a matrix.  I've tried this:

split.screen(matrix(c(0,0.5,0,0.5,  0.5,1,0.5,1), byrow=F, ncol=4))

and a couple of variants on it, but get the same error:

Error in par(.split.screens[[cur.screen]]) :
         invalid value specified for graphics parameter "fig".

The help usefully says that they are defined in NDC units, but I don't 
know what an NDC unit is, and there isn't any example.  The code in 
kjetil brinchmann halvorsen's message on R-help on  Mar 31 2003 (do a 
search for "NDC units"!) didn't work either, it gives the same message:

 > split.screen( matrix( c(0, 0.3, 0.5, 1, 0.3, 0.7, 0.5, 1,
+ + 0.7, 1, 0.5, 1, 0, 0.5, 0, 0.5,
+ + 0.5, 1, 0, 0.5), 5, 4, byrow=TRUE))
Error in par(.split.screens[[cur.screen]]) :
         invalid value specified for graphics parameter "fig".

I get the same in R-1.8.1 on Windows, and R-1.5.1 on Linux.
As Kjetil pointed out then, "NDC" is not explained in the help pages, 
and I don't have my copy of MASS with me.

Bob

-- 
Bob O'Hara

Rolf Nevanlinna Institute
P.O. Box 4 (Yliopistonkatu 5)
FIN-00014 University of Helsinki
Finland
Telephone: +358-9-191 23743
Mobile: +358 50 599 0540
Fax:  +358-9-191 22 779
WWW:  http://www.RNI.Helsinki.FI/~boh/




More information about the R-help mailing list