0

I can add text labels to scatterplot points using text() function. But in this case all of the labels can be placed either to the left, right, above, or below the points. I would prefer to have the labels on the left side in most instances except for few where I need the labels to be above the points (to avoid overlap). One way to do that would be adding labels to each point individually, but that would be too cumbersome for large observations. I was wondering if there is any other way to achieve the goal.

Thanks in advance.

Oposum
  • 1,155
  • 3
  • 22
  • 38
  • How about `text(x, y, labels = c(...), pos = 1, offset = 0.5, ...)`? – Dale Jul 09 '14 at 02:01
  • This is what I have been doing, but I need pos=2 for most of them and pos=3 for some. Offset does not help. – Oposum Jul 09 '14 at 09:30
  • I've googled this and immediately find [this question](http://stackoverflow.com/questions/7611169/intelligent-point-label-placement-in-r) and [this one](http://stats.stackexchange.com/questions/16057/how-do-i-avoid-overlapping-labels-in-an-r-plot). – BartekCh Jul 09 '14 at 10:19
  • Thanks for your suggestion. These did not end up being helpful for my case. What I finally figured out though was four different text() commands applied to subsets of data and varying "pos" from 1 to 4. That may not be the ideal fix but worked out pretty well visually. – Oposum Jul 09 '14 at 23:58

0 Answers0