如何将文本添加到水平图? [英] How to add a text to a levelplot?
本文介绍了如何将文本添加到水平图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
library(raster)
library(rasterVis)
r <- raster(nrows=10, ncols=10)
r <- setValues(r, 1:ncell(r))
levelplot(r)
我想在xlab经度"下放一个词(一段文字)是原始地图"
I want to put a word (a text) that is "Original map" under the xlab "Longitude"
这可能吗?
推荐答案
这是一个手动解决方案,但您可以使用 mtext
在带有 line
和adj
参数将其放在您想要的位置(或 text
).
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)
这篇关于如何将文本添加到水平图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文