我很难找到调整地图标签位置的参数。我已经阅读了几个命令来执行此操作,但我发现这很困难。这是我的 rstudio 代码。如有任何意见或建议,我们将不胜感激。
shp_peru = read_sf("DEPARTAMENTOS_inei_geogpsperu_suyopomalia.shp") shp_peru = shp_peru %>% mutate(centroid = map(geometry, st_centroid), coords = map(centroid, st_coordinates), coords_x = map_dbl(coords, 1), coords_y = map_dbl(coords, 2)) theme_set(theme_bw()) shp_peru = ggplot(data = shp_peru) + geom_sf()+geom_sf(fill="skyblue") + geom_text_repel(mapping = aes(coords_x, coords_y,label=NOMBDEP), size = 2, min.segment.length = 0.5, force=50) + labs(x = "", y = "") + theme_classic() + theme(legend.position = "bottom", axis.title.x = element_blank(), axis.text.x = element_blank(), axis.ticks.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank(), axis.ticks.y = element_blank(), axis.line.y = element_blank(), axis.line.x = element_blank(), legend.title = element_blank(), legend.key.size = unit(0.5, "cm"), legend.text = element_text(size=12), text = element_text( family = "sans"))