ggplot2:通过连接点创建一个ploygon

时间:2016-09-02 14:45:17

标签: r ggplot2

我想通过连接数据点来创建一个带ggplot2的多边形。但是,它没有给我一个多边形。我的代码有什么问题?

 Longitude=c(0,30,30,0,0)
 Latitude=c(0,0,30,30,0)
 data.frame(lon=Longitude,lat=Latitude)%>%
       ggplot(aes(x=lon,y=lat))+geom_line()

enter image description here

0 个答案:

没有答案