1

I'm doing some scatterplots with labels added, something like this:

require(ggplot2)
ggplot(mtcars, aes(mpg, wt, fill=factor(cyl))) + geom_point(shape=21, size=4) + 
  geom_text((aes(label=rownames(mtcars), color=factor(cyl))))

enter image description here

If you look closely at the legend, you'll see the letter 'a' over the drawing of the points (each with different color, of course). I want a way to eliminate this, but I keep trying with guides and guide_legends to no avail. The legend I would like should look like in this other plot:

ggplot(mtcars, aes(mpg, wt, fill=factor(cyl))) + geom_point(shape=21, size=4)

enter image description here

Thanks in advance, Juan

Juan
  • 1,351
  • 1
  • 14
  • 28

0 Answers0