Plotting 5 graphs in a 3-2 layout in R
----- ----- -----
| A | | B | | C |
----- ----- ----
----- -----
| D | | E |
----- -----
or
----- -----
| A | | B |
----- -----
----- ----- -----
| C | | D | | E |
----- ----- -----
I have 5 plots and I wanted to fit into 1 plot, structured as above. Got some kick from this post: Plotting 3 graphs in a 2-1 layout in R to use the layout () function, but just failed to get it right.
Can anyone please help? Thank you so much.
Update
Just tied my plot, after committing the structure. Many thanks for the help.
+3
source to share
2 answers
you can get the aforementioned graph using layout since you think you cannot divide the width of the second row with odd columns.
layout(matrix(c(1,2,3,4,4,5), 2, 3, byrow = TRUE))
hist(as.matrix(1:10))
hist(as.matrix(1:10))
hist(as.matrix(1:10))
hist(as.matrix(1:10))
hist(as.matrix(1:10))
+1
source to share