我使用ggsave函数保存了一个图像,如下所示
但我希望有这样的输出
al1 <- get_map(location = c(lon = -86.304474, lat = 32.362563), zoom = 11, maptype = 'terrain')
lon<--86.304474
lat<-32.362563
df<-data.frame(lon,lat)
a+ggplot(df)
ggmap(al1)+geom_point(data=df,aes(x=lon,y=lat),size=2)
我试图删除x和y轴值但问题是图像在面板上有白色背景但我只想要绘图图像 .
1 回答
在
ggmap()
函数中,您需要extent = "device"
. 有关更多选项,请参阅?ggmap::ggmap
.以下将给出您想要的结果 .