Screen split (with unequal windows) in R

I know that I can use par(mfrow=c(1, 2)) to create a split-screen graph. Nevertheless, I would really like to create a graph in which 2/3 of the window is used to build one graph, and 1/3 of the window is used to build another. Is it possible?

+7
source share
2 answers

You need to use the layout function instead of par here, with argument widths :

 layout(matrix(c(1,2),nrow=1), widths=c(2,1)) 

See ?layout more details.

+12
source

alternatively:

 a <- c(1:10) b <- c(1:10) par(fig=c(0, (2/3), 0, 1)) par(new=TRUE) plot(a, b) par(fig=c((2/3), 1, 0, 1)) par(new=TRUE) plot(a, b) 
+7
source

All Articles