Is it possible to obtain 3 plots in a single figure in R with a distribution as shown in the image below? The plots must have the same width, and plot C should be centered.
----- -----
| A | | B |
----- -----
-----
| C |
-----
Thanks!
Yes, with the
layout(...)
function.So
layout(...)
takes a matrix where each element corresponds to a plot number. In this case, [1,1] corresponds to the first plot, [1,2] corresponds the the second plot, and [2,1:2] corresponds to the third plot.This example is taken with slight modification from here.
If you want the bottom plot to be the same "width" as the two above, you can tweak the margins for that plot.