Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 从地图中移动谷歌标签的位置_R_Label_Ggmap - Fatal编程技术网

R 从地图中移动谷歌标签的位置

R 从地图中移动谷歌标签的位置,r,label,ggmap,R,Label,Ggmap,我用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,

我用
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) +
这导致:

这基本上正是我想要的,但在第二张地图上,谷歌的标签被删掉了。如何“移动”标签,使其像第一张地图一样可见

scale_x_continuous(limits = c(5, 12)) 
scale_y_continuous(limits = c(45, 48))