Is it possible to reposition the labels such that in sector (-x,y) the label is on the left and sector (+x,y) the label is on the right?
+5
A:
I'm not definitely sure if this is what you were looking for:
library("ggplot2")
tmp <- data.frame(x=-5:5, y=rnorm(11), lab=LETTERS[1:11])
p <- ggplot(aes(x=x, y=y, label=lab), data=tmp) +
geom_point() +
geom_text(data=subset(tmp, x > 0), hjust=-0.5) +
geom_text(data=subset(tmp, x <= 0), hjust=1.5)
print(p)
rcs
2009-12-21 11:55:09
That's exactly what I'm looking for. Thanks!
Brandon Bertelsen
2009-12-21 16:32:46