[R] Three graphs

kjetil brinchmann halvorsen kjetil at entelnet.bo
Mon Mar 31 23:31:06 CEST 2003


On 31 Mar 2003 at 6:00, Kenneth Cabrera wrote:

There are multiple ways to do this, see

?layout
?split.screen

split.screen seems to be the best for what you ask. But, split.screen
seems to be broken in rw1062, so the following example is from R-
devel (1.7 to be), on windows:

> par(bg="white")
> 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))
[1] 1 2 3 4 5
> screen(2)
> plot(1:10, 1:10)
> screen(4)
> plot(1:10, 1:10)
> screen(5)
> plot(1:10, 1:10)
> close.screen(all=TRUE)

I defines two plots not to be used, to qchieve the centering of the 
upper plot. (That might not be necessary, try). 

By the way, the help page for split.screen is a bit cryptic, it says

figs A two-element vector describing the number of rows and the 
number of columns in a screen matrix or a matrix with 4 columns. If a 
matrix, then each row describes a screen with values for the left, 
right, bottom, and top of the screen (in that order) in NDC units. 

without explaining what is NCD units. help.search("NCD") doesn't 
help, and NDC is not in the index of either MASS4 or 'S Programming'. 

But MASS4 (page 78) has a better explanation, can that be 
incorporated into the help page?

Kjetil Halvorsen




> Hi R-users:
> How can I obtain 3 graphics in a page but, one on the top and centered, and
> the other two in the bottom ?
> 
> Thank you for your help
> 
> -- 
> Kenneth Roy Cabrera Torres
> Celular +57 (315) 405 9339
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help



More information about the R-help mailing list