Closed Schuch666 closed 2 months ago
I have added a new function add_mtext
that uses the map's margins.
library(terra)
f <- system.file("ex/elev.tif", package="terra")
r <- rast(f)
plot(r, axes=FALSE, legend=FALSE)
add_box()
for (i in 1:4) add_mtext("margin text", i, cex=i, col=i, line=2-i)
The function may need some more work to support fancy stuff.
An alternative approach would be to use text(x, y, "text", xpd=TRUE)
Thanks it works!
Is there a equivalent function of mtext from base, to include text outside the ploting region of maps using terra::plot() ? There is a way to make it work with mtext or other way to plot outside the map from terra::plot?