1) Is there any R library/function which would implement INTELLIGENT label placement in R plot? I tried some but they are all problematic - many labels are overlaping either each other or other points (or other objects in the plot, but I see that this is much harder to handle).
2) If not, is there any way how to COMFORTABLY help the algorithm with the label placement for particular problematic points? Most comfortable and efficient solution wanted.
You can play and test other possibilities with my reproducible example and see if you are able to achieve better results than I have:
# data
x = c(0.8846, 1.1554, 0.9317, 0.9703, 0.9053, 0.9454, 1.0146, 0.9012,
0.9055, 1.3307)
y = c(0.9828, 1.0329, 0.931, 1.3794, 0.9273, 0.9605, 1.0259, 0.9542,
0.9717, 0.9357)
ShortSci = c("MotAlb", "PruMod", "EriRub", "LusMeg", "PhoOch", "PhoPho",
"SaxRub", "TurMer", "TurPil", "TurPhi")
# basic plot
plot(x, y, asp=1)
abline(h = 1, col = "green")
abline(v = 1, col = "green")
For labelling, I then tried these possibilities, no one is really good:
1) this one is terrible:
text(x, y, labels = ShortSci, cex= 0.7, offset = 10)
2) this one is good if you don't want to place labels for all points, but just for the
outliers, but still, the labels are often placed wrong:
identify(x, y, labels = ShortSci, cex = 0.7)
3) this one looked promissing but there is the problem of labels being too close to the
points; I had to pad them with spaces but this doesn't help much:
require(maptools)
pointLabel(x, y, labels = paste(" ", ShortSci, " ", sep=""), cex=0.7)
4)
require(plotrix)
thigmophobe.labels(x, y, labels = ShortSci, cex=0.7, offset=0.5)
5)
require(calibrate)
textxy(x, y, labs=ShortSci, cx=0.7)
Thank you in advance!
EDIT: todo: try labcurve {Hmisc}.
Question&Answers:
os