How to add a text to a levelplot?

烈酒焚心 提交于 2019-12-12 01:28:54

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!