R语言使用fortify函数绘制地图导致撕裂|shp geom_polygon

用R绘制地图总是各种错误…真是….

没啥好说的,注意看看group和id的属性吧:
错误实例:geom_polygon(data = coast_map, aes(x = long, y = lat, group = id), fill = “grey95”, colour = “grey60”)

正确实例:geom_polygon(data = coast_map, aes(x = long, y = lat, group = group), fill = “grey95”, colour = “grey60”)
注意看数据的结构,分类哪个更好就用哪个

本文采用 CC BY-NC-SA 4.0 创作共享协议,转载请标注以下信息:
【转载自LiuJason's Blog:https://www.liujason.com/article/222.html

说点什么

Please Login to comment
avatar
  Subscribe  
提醒