I want to position a plotmath symbol (x bar) in a plot using ggplot2. Somehow the way I do it alters the legend. The letter “a” suddenly appears. Where do I go wrong here?
d <- data.frame(x=rnorm(10), y=rnorm(10), g=rep(c("m", "w"), 5))
ggplot(d, aes(x, y, group=g, color=g)) + geom_point() +
geom_text(x=0, y=0, label="bar(x)", parse=T)

This will fix the problem:
Only add colour the points.
Or, if you want to annotate the plot, annotations will not be placed in the legend so
would work.