Labelling points with ggplot2 and directlabels

后端 未结 4 1050
借酒劲吻你
借酒劲吻你 2020-12-11 12:27

This is a follow-up to my earlier question. While the answer by krlmlr somehow helps to solve my problem, one issue remains - the labels are moved far away from the points s

4条回答
  •  死守一世寂寞
    2020-12-11 12:37

    Maybe hjust and vjust is what you are looking for?

    ggplot(test, aes(x=x, y=y)) + 
      geom_point(aes(colour=group)) + 
      geom_text(aes(label=ID), show_guide=F, hjust = 1.2, vjust = 0.5)
    

提交回复
热议问题