Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 R-package rasterVis 中的 levelplot 函数绘制栅格时,如何将特定颜色分配给栅格的 NA 值?我正在寻找与“colNA”类似的功能。
levelplot使用背景颜色来显示NA值。因此,您必须使用panel.background.
levelplot
NA
panel.background
library(rasterVis) myTheme <- BTCTheme() myTheme$panel.background$col = 'gray' f <- system.file("external/test.grd", package="raster") r <- raster(f) levelplot(r, par.settings = myTheme)