Skip to content
Prev 333391 / 398506 Next

Help with removing extra legend elements in ggplot

The additional element comes from this code:

geom_point(aes(color = VegType, shape = VegType, size = 10))

Take the size argument outside the aes() statement and the legend will
disappear:

geom_point(aes(color = VegType, shape = VegType), size = 10)

The aes() statement maps a variable to a plot aesthetic. In this case
you're mapping VegType to color and shape. You want to *set* the size
aesthetic to a constant value, and that is done by assigning the value
10 to the size aesthetic outside of aes().

Dennis
On Tue, Nov 19, 2013 at 4:35 PM, Matthew Van Scoyoc <scoyoc at gmail.com> wrote: