• Welcome to LiuJason's Blog!

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

R语言 Jason 6 years ago (2019-02-26) 1815 Views 0 Comments QR code of this page

用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
Like (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址