如何在R软件包tmap中为专题地图使用连续颜色比例?
当我使用如何在R软件包tmap中为专题地图使用连续颜色比例?,r,gis,data-visualization,choropleth,tmap,R,Gis,Data Visualization,Choropleth,Tmap,当我使用tmap创建一个choropleth,其中一个连续变量映射为填充颜色时,tmap将变量离散化并按类别打印颜色。例如,此代码 library(tmap) data(World) tm_shape(World) + tm_polygons(col="gdp_cap_est") 生成一张地图,其中国家根据其人均GDP是否在0-20000美元、20000-40000美元等范围内进行着色。我想要一张地图,其中GDP/人均连续映射到颜色或颜色深浅处,以便GDP的微小差异导致地图上的颜色微小差异。t
tmap
创建一个choropleth,其中一个连续变量映射为填充颜色时,tmap
将变量离散化并按类别打印颜色。例如,此代码
library(tmap)
data(World)
tm_shape(World) + tm_polygons(col="gdp_cap_est")
生成一张地图,其中国家根据其人均GDP是否在0-20000美元、20000-40000美元等范围内进行着色。我想要一张地图,其中GDP/人均连续映射到颜色或颜色深浅处,以便GDP的微小差异导致地图上的颜色微小差异。tmap有这种能力吗 我们可以使用
style
=cont
或order
library(tmap)
data(World)
# Map the value to a continuous gradient
tm_shape(World) +
tm_polygons(col = "gdp_cap_est",
style = "cont")
# Map the order to a continuous gradient
tm_shape(World) +
tm_polygons(col = "gdp_cap_est",
style = "order")