I have three plots which I would to arrange in a single window. I can arrange similar-sized plots on a regular 2*2 grid using par(mfrow = c(2, 2)):
par(mfrow = c(2, 2))
plot(1:10, main = "plot1")
plot(10:1, main = "plot2")
plot(rnorm(10), main = "plot3")
However, I want to position “plot1” and “plot2” beside each other on the top row, and “plot3” below them, centered horizontally. How can I achieve this?
You probably want
layout, you can set up pretty complex grids by creating a matrix.Use
layout.showto see each panel.Print out the matrix to see how this works:
There are 1s for the first panel, 2s for the second, etc. 0s for the “non-panel”.
See
help(layout).