如何删除R包“rasterVis”中“levelplot”中的框架

时间:2014-06-11 21:05:43

标签: r raster lattice figure rastervis

我想删除栅格数据集的“levelplot”图中的框框。不知道怎么做。

library(raster)
library(rasterVis)

f <- system.file("external/test.grd", package="raster")
r <- raster(f)
s <- stack(r, r+500, r-500)
levelplot(s, contour=TRUE)
levelplot(s)
levelplot(s,box=FALSE,axes=FALSE) # It doesn't work.

1 个答案:

答案 0 :(得分:9)

[编辑:数字已添加]

最后一个?wireframe

示例中描述了您想要实现的目标
levelplot(s, contour = TRUE, par.settings = list(axis.line = list(col = "transparent")), 
          scales = list(col = "black"))`

Box frame removed

如果要删除条带背景和颜色:

levelplot(s, contour=TRUE, par.settings = list(axis.line = list(col = "transparent"), 
          strip.background = list(col = 'transparent'), 
          strip.border = list(col = 'transparent')), 
          scales = list(col = "black"))`

Box frame, strip background and color removed