I have 4 maps to plot and would like to plot them in a single plot area so I use the code
par(mfrow=c(2,2), bty="n")
However, the result is lots of useless blank space around my maps (which become also too small).
The image below shows how much space is taken up by each map (blue rectangle) relative to the plot area.
Is it possible to go from the current situation (cf. 2 x 2 plot fit) to the desired situation (cf. Desired better fit)?
I tried changing width and height parameters (dev.new(width=x, height=y)
) but with no luck.
I would suggest using the
layout
function, though usingpar
is fine too. I give a simple example below, in which you can adjustpar(mar=c())
settings for each individual plot, bringing them closer together.layout
allows you to adjust relative heights of plots with theheight
parameter, which might be useful when trying to get panel plots to be all the same height, when you have the x-axis only for the lower tier plots.