How to clean point labels in a simple ggplot2 scatter chart?

See examples from http://had.co.nz/ggplot2/geom_text.html ; they are pretty terrible. Labels overlap, go beyond the schedule, etc.

I thought directlabels might help, but actually it is not:

direct.label(qplot(wt,mpg,data=mtcars,colour=rownames(mtcars))) 

Manual positioning of each tag is tedious. We hope that makes tags more convenient. Anything that might fit the bill?

+7
source share
1 answer

Hope this is not too late for an answer. I'm not talking about ggplot2 right now, I used the usual scatterplots using plot (). I tried a lot of labeling algorithms and the best thing was pointLabel () from package maptools with label packing with spaces :-)

 pointLabel(x, y, labels = paste(" ", point_names, " ", sep="") 

I tried thigmophobe.labels () from the package template, textxy () from package calibration or standard text (), but I think pointLabel () was the best.

But in any case, for my purpose, I ended up just using the ident () function, and I just clicked on the points for which I need a shortcut - very useful, you just click on the outliers and some interesting points, what it is!

Thomas

+1
source

All Articles