1

根据提供的文档,对于 choropleth 包中的离散变量,set_num_colors 命令在 9 次中断时达到最大值。

有没有办法解决这个问题?

谢谢

choro <- CountyChoropleth$new(imp[[i]])
choro$title <- paste0(as.character(forImg$year[i]),"        ", "SGL RISK INDEX")
choro$ggplot_scale = scale_fill_viridis(name="Risks rank", discrete=TRUE, option="C" , na.value="grey50")
choro$set_num_colors(8)
choro$render() -> impImg
ggsave(filename=paste0("impImg", "-",i, ".png"), bg="white", dpi=175, height = 1080, width=1920, units = "px")
4

1 回答 1

0

您将需要构建和使用具有足够元素的调色板:

https://www.datanovia.com/en/blog/easy-way-to-expand-color-palettes-in-r/

https://www.r-graph-gallery.com/40-rcolorbrewer-get-a-longer-palette.html

于 2021-08-11T21:10:37.740 回答