问题
library(raster)
library(rasterVis)
r <- raster(nrows=10, ncols=10)
r <- setValues(r, 1:ncell(r))
levelplot(r)
I want to put a word (a text) that is "Original map" under the xlab "Longitude"
Is this possible?
回答1:
This is a manual solution, but you can use mtext
to place text around margins with line
and adj
parameters to put it where you want (or text
).
plot.new() # open new plot
r <- raster(nrows=10, ncols=10)
r <- setValues(r, 1:ncell(r))
levelplot(r)
mtext("Original map", 1, line=-3.4, adj=0.4)
来源:https://stackoverflow.com/questions/31893883/how-to-add-a-text-to-a-levelplot