This is related to an example posted earlier today for which I
couldn't get the solution. Here
is an example that focuses on this topic.
I used geom_text to label some points by a group. The text is colored
by group, and the
letter 'a' appears in the legend corresponding to the color.
How do I remove this 'a' from the legend?
x <- seq(1:10)
y <- x
mygroups <- c(rep("A",5),rep("B",5))
mydata <- data.frame(x,y,mygroups)
p <- ggplot(data=mydata,aes(x=x,y=y,label=mygroups))
p <- p + geom_point(aes(colour=mygroups))
p <- p + geom_text(hjust=2, aes(colour = mygroups), size = 3)
p
Thanks,
Juliet
There's an experimental undocumented feature that you can also use:
p <- p + geom_text(hjust=2, aes(colour = mygroups), size = 3, legend = F)
Hadley