如何解决从 ggmap 中移动 google 标签的位置
我使用 ggmap()
创建了以下瑞士地图:
这是地图的代码:
map <- get_googlemap(center = c(lon = 8.3,lat = 46.5),zoom = 7,scale = 2,maptype ='satellite',size = c(640,640))
ggmap(map_transparent) +
geom_polygon(aes(x = long,y = lat,group=id),data = shape_switzerland,color ="white",fill ="orangered4",alpha = .2,size = 0.4) +
ggsn::scalebar(x.min = 9.5,x.max = 11,y.min = 45,y.max = 45.25,dist = 100,dist_unit = "km",transform = T,model = "WGS84",height = 0.4,st.dist = 0.4,location = "topright",st.color = "black",st.size = 4) +
您将无法重现此示例,因为您没有 shapefile shape_switzerland
,但对于我的问题,这不是必需的 ;)
我通过在代码中添加这两行来更改地图的大小:
scale_x_continuous(limits = c(5,12))
scale_y_continuous(limits = c(45,48))
结果:
这基本上正是我想要的,但在第二张地图上,谷歌标签被剪掉了。我如何“移动”标签,使其像在第一张地图上一样可见?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。