2009-12-21 70 views

回答

8

我不肯定知道,如果這是你要找的人:

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) 

geom_text labeling http://img8.imageshack.us/img8/1056/geomtext.png

+0

這正是我要找的。謝謝! – 2009-12-21 16:32:46