我在地图上的点彼此非常接近,我想将标签分开,因为它们是重叠的。我想使用 spread.labels 命令,但是我在这条线上得到了一个错误:
Error in text.default(newx, y + offsets, labels[sort.index], srt = srt, : plot.new has not been called yet
mp = get_map(location = "Canada", maptype="satellite", color="color")
p = ggmap(mp) +
geom_point(data=df1, aes(x=decLon, y = decLat), color="red", size=2.6) +
spread.labels(x=df1$decLon, y=df1$decLat, label=df1$Site, offsets=0.5)
p