简体   繁体   中英

Removing colour scale on spplot in R?

我想删除 R 中 spplot 右侧的色阶。是否有我可以添加到我的绘图调用的参数,允许我这样做只留下没有颜色图例的地图?

尝试colorkey=FALSE ,作为spplot命令的附加输入。

Note that colorkey=FALSE works for gridded data, but not for point data. If you need for point data, use auto.key=FALSE (from this thread ):

## prepare data
library(sp)
data(meuse.grid)
gridded(meuse.grid)=~x+y
data(meuse)
coordinates(meuse)=~x+y

## Gridded data
spplot(meuse.grid, "dist", colorkey=FALSE) 

# point data
spplot(meuse, "elev", colorkey=FALSE)   # does not work

spplot(meuse, "elev", auto.key=FALSE) 

Created on 2020-02-02 by the reprex package (v0.3.0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM