How can we write a legend that overlay several frames?
Using the xpd
parameter, the legend can exit its frame but still cannot enter the next frame.
par(mfrow=c(1,2))
plot(rnorm(120), rnorm(120))
legend(x = -0.1, y=0.1, legend = "Legend that covers both plots", text.col="red", cex=2, box.col="red", xpd=TRUE)
plot(rnorm(120), rnorm(120))
One dummy solution would be to add the same legend on each frame so that they perfectly complement each other. But that would be a real pain.
Using mtext is not so good but maybe!