如何删除spplot中的zcol框?

问题描述 投票:0回答:1

我想删除spplot中变量名周围的框(在下面的示例中为“镉”,“铜”,...,或至少更改其桃红色。

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)

Example image from https://edzer.github.io/sp/

r plot gis lattice sp
1个回答
0
投票

spplot调用网格图形,因此您可以使用par.settings为zcol(称为strips)传递其他参数。有关您可以传递的完整参数列表,请选中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)

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.