Without a reproducible question, I'll show one way to do it with
generic data. You'll have to adapt it to your work.
Multi-plot can be done using par(mfrow=c(2,3))
, and though it is simple, it is the most restrictive. Other options include layout(...)
(which won't work for this, I think) and par(fig=...)
(which is what I use here). A reasonable starting reference is here.
I'll start with your map (NB: please include required libraries with your code):
library(maps)
library(mapdata)
par(fig=c(0,1,0,1)) # force full-device plot
plot(1, 1, type="n", xlab="", ylab="", axes=F,
xlim=c(-39,-35.5),ylim=c(-55,-54))
map("worldHires", regions="Falkland Islands:South Georgia",col="#BFBFBF",
fill=F, add=T, bg="#7F7F7F", lwd=0.05)
Next I'll set up a matrix to be used for defining the plot region, mimicking the arrangement you defined using par(mfrow=c(2,3))
:
xs <- seq(0, 1, len=4)
ys <- seq(0, 1, len=3)
m <- merge(cbind(head(xs, n=-1), tail(xs, n=-1)),
cbind(head(ys, n=-1), tail(ys, n=-1)),
by=NULL)
## V1.x V2.x V1.y V2.y
## 1 0.0000000 0.3333333 0.0 0.5
## 2 0.3333333 0.6666667 0.0 0.5
## 3 0.6666667 1.0000000 0.0 0.5
## 4 0.0000000 0.3333333 0.5 1.0
## 5 0.3333333 0.6666667 0.5 1.0
## 6 0.6666667 1.0000000 0.5 1.0
par(fig=...)
takes the left and right (x) and bottom and top (y) percentages. The first row of m
says that the next plot will include from 0 to 33% horizontally and 0 to 50% vertically of the screen (i.e., the bottom left corner). The first plot call does not strictly need a par(fig=...)
call, but I like to have it there so that I reset the plot layout when I redo the plot. It should either omit new=TRUE
or use new=FALSE
to be explicit (arguably a good thing at times like this).
Next I'll just throw in some charts. This part is my contrived part, but it shows how it's being used. The programmatic definition of m
and its use below is not completely necessary; you can easily define each par(fig=...)
call manually. Regardless, the use of a simple 2x3 grid of plots is also unnecessary and this method allows for placing the histograms in meaningful locations on the map. (This can obviously be done programmatically but is completely up to you and your data.)
columns <- c('mpg', 'hp', 'drat', 'wt', 'qsec')
for (i in 1:5) {
par(fig=unlist(m[i,]), new=TRUE)
col <- names(mtcars)[i]
hist(mtcars[[col]], col=1+i, main=col)
}