Scatter plot text jammed together
1
0
Entering edit mode
7.6 years ago
moxu ▴ 510

In a scatter plot, sometimes you may want to label some points with text. The problem is that in R, there is not (or I cannot find out) a way to automatically label each selected point and not to allow overlaying the labelling text to each other.

Any one knows an easy way to avoid this in R?

Thank you!

R • 1.0k views
ADD COMMENT
2
Entering edit mode
7.6 years ago

If you are using ggplot2, the answer is ggrepel. See https://cran.r-project.org/web/packages/ggrepel/index.html and https://cran.r-project.org/web/packages/ggrepel/vignettes/ggrepel.html

(And if you aren't using ggplot2, well, then you should)

ADD COMMENT
0
Entering edit mode

Awesome! Thanks much!

And -- I love biostars. :)

ADD REPLY

Login before adding your answer.

Traffic: 1545 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6