# Here are two options:
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point() + geom_text(aes(x = 5, y 30,
label = "A Label"))
#or
response <- c(2,4)
xvar <- c(1,2)
label <- response;
myData <- data.frame(response,xvar,label)
p <- ggplot(myData, aes(y=response, x=xvar))
p + geom_bar(position="dodge", stat="identity") +
geom_text(aes(y=response+1,label=label))
On Thu, May 14, 2009 at 1:22 PM, stephenb <stenka1@go.com> wrote:
>
> is there a way to label points in a graph using
text(locator(1),"text")
> after ggplot() or qplot() ?
>
> > qplot(date, psavert, data = economics, geom =
"line",main="jhdjd")->p
> > p+opts(text(locator(1),"HHHH"),new=T)
>
> does not work.
> --
> View this message in context:
>
http://www.nabble.com/text%28%29-to-label-points-in-ggplot-tp23545135p23545135.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
>
http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]