在 shapefile 的图例中显示所有值
Display all values in the legend of a shapefile
示例数据:
library(raster)
fra <- getData("GADM", country = 'FRA', level = 1)
spplot(fra, "ID_1")
由于 ID_1
是整数,我想显示图例中的所有值,并用 ID_1
.
标记多边形
spplot(fra, "ID_1",
colorkey = list(labels = list(at = fra@data$ID_1, labels = fra@data$NAME_1)))
示例数据:
library(raster)
fra <- getData("GADM", country = 'FRA', level = 1)
spplot(fra, "ID_1")
由于 ID_1
是整数,我想显示图例中的所有值,并用 ID_1
.
spplot(fra, "ID_1",
colorkey = list(labels = list(at = fra@data$ID_1, labels = fra@data$NAME_1)))