【发布时间】:2017-12-23 23:35:11
【问题描述】:
各位可视化爱好者,
我正在尝试创建一个彩色地图图,例如: (来源:https://github.com/hrbrmstr/albersusa)
但是我希望这张地图有偏差,以便各州的面积与我提供的值成比例(特别是,我使用 GPD 值)。 我的意思是我希望一些州看起来更大,一些州看起来更小,它们实际上是但尽可能提醒真实的美国地图。 状态移动或形状破坏没有问题。
有什么想法吗?有什么现成的解决方案吗? 目前我使用 R 和 albersusa 包,因为它是我熟悉的东西。开放改变! 我当前的情节代码是:
gmap<-
ggplot() +
geom_map(data = counties@data, map = cmap,
aes(fill =atan(y/x),alpha=x+y, map_id = name),
color = "gray50") +
geom_map(data = smap, map = smap,
aes(x = long, y = lat, map_id = id),
color = "black", size = .5, fill = NA) +
theme_map(base_size = 12) +
theme(plot.title=element_text(size = 16, face="bold",margin=margin(b=10))) +
theme(plot.subtitle=element_text(size = 14, margin=margin(b=-20))) +
theme(plot.caption=element_text(size = 9, margin=margin(t=-15),hjust=0)) +
scale_fill_viridis()+guides(alpha=F,fill=F)
【问题讨论】:
-
您可以尝试制作地图吗?见here。
标签: r ggplot2 shapefile geo matplotlib-basemap