R: How to partially overlap cards using layout ()

I have three maps of the same region in different years. I want to lay them next to each other, very close to each other. I know how to use the layout () function to do this, but they stay far apart. This is what I get:

maps too far from each other

This is what I want:

maps closer to each other

I need some kind of cell overlap in the matrix passed to the layout () function. Or the axis offset of the plot () function. But I could not find anything like it. Any help please?

+4
source share
1 answer

You can choose how your maps should be arranged without layout() . par(new=TRUE) and par(plt=...) are keys.
You made a pretty schedule! However, given the data that I plotted, I would not have made a continuous color bar.

 library("maps") par(list(mar=c(0,0,4,0), bg="black")) plot(0:1, 0:1, type="n", xlab="", ylab="", axes=FALSE) title("Trois cartes de France se chevauchant", col.main="white") # Random colors to highlight the overlapping. set.seed(13) par(list(new=TRUE, plt=c(.6, 1, .1, .9))) plot(map("france", plot=FALSE), type="l", axes=FALSE, xlab="", ylab="", col=sample(c("white", "blue", "red"), 1)) par(list(new=TRUE, plt=c(.3, .7, .1, .9))) plot(map("france", plot=FALSE), type="l", axes=FALSE, xlab="", ylab="", col=sample(c("white", "blue", "red"), 1)) par(list(new=TRUE, plt=c(0, .4, .1, .9))) plot(map("france", plot=FALSE), type="l", axes=FALSE, xlab="", ylab="", col=sample(c("white", "blue", "red"), 1)) 

enter image description here

+1
source

Source: https://habr.com/ru/post/1500566/


All Articles