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")
注意看数据的结构,分类哪个更好就用哪个


This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/222.html
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy