如何删除 spplot 中的 zcol 框?

How to remove zcol boxes in spplot?

我想删除 spplot 中变量名称周围的框(在下面的示例中为 "cadmium"、"copper"、...),或者至少更改它们的桃色.

library(sp)
rv = list("sp.polygons", meuse.riv, fill = "lightblue")
scale = list("SpatialPolygonsRescale", layout.scale.bar(), 
offset = c(180500,329800), scale = 500, fill=c("transparent","black"), which = 4)
text1 = list("sp.text", c(180500,329900), "0", cex = .5, which = 4)
text2 = list("sp.text", c(181000,329900), "500 m", cex = .5, which = 4)
arrow = list("SpatialPolygonsRescale", layout.north.arrow(), 
offset = c(181300,329800), 
scale = 400, which = 4)
cuts = c(.2,.5,1,2,5,10,20,50,100,200,500,1000,2000)
spplot(meuse, c("cadmium", "copper", "lead", "zinc"), do.log = TRUE,
key.space = "right", as.table = TRUE,
sp.layout=list(rv, scale, text1, text2, arrow), # note that rv is up front!
main = "Heavy metals (top soil), ppm", cex = .7, cuts = cuts)

spplot 调用网格图形,因此您可以使用 par.settings 为 zcols(称为条带)传递附加参数。有关您可以传递的完整参数列表,请查看 table 23.3 of lattice manual。您可以在列表中指定它们,如下所示:

my.settings <- list(
  strip.background=list(col="lightblue"),
  strip.border=list(col="transparent")
)

spplot(meuse, c("cadmium", "copper", "lead", "zinc"), do.log = TRUE,
key.space = "right", as.table = TRUE,
sp.layout=list(rv, scale, text1, text2, arrow), # note that rv is up front!
main = "Heavy metals (top soil), ppm", cex = .7, cuts = cuts,
par.settings=my.settings)