library(terra)
library(RColorBrewer)
# sample polygon
p <- system.file("ex/lux.shp", package="terra")
p <- terra::vect(p)
# sample raster
r <- system.file("ex/elev.tif", package="terra")
r <- terra::rast(r)
r <- terra::crop(r, p , snap = "out", mask = T)
terra::plot(r,
col = brewer.pal(9, "pastel1"),
cex.main = 2,
smooth = T,
legend = T,
plg = list(title = "Score"),
axes = TRUE,
mar=c(3,3,3,6))
plot(p, add = T)
如何更改图例标题“得分”的大小和方向。我想定向标题,使其垂直并沿着图例,并更改图例标题的大小?
1条答案
按热度按时间1zmg4dgp1#
你可以在任何你想要的地方添加文本。比如说,