Skip to content
Prev 42557 / 398506 Next

Using split.screen

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