How to remove an aesthetic from a ggplot2 legend How to remove an aesthetic from a ggplot2 legend r r

How to remove an aesthetic from a ggplot2 legend


You can suppress the legends at the layer level. If you move the colour aesthetic from the initial call to ggplot to the jitter layer, that seems to give the effect you are after. I'm a bit confused though as to why you would want to colour based on date and not provide the key as to what the colors mean...but that's a more philosophical question for you to ponder.

ggplot(data=w, aes(OAD,RtgValInt,shape=Port)) +  geom_jitter(size=3, alpha=0.75, color=dt, legend = FALSE) +  scale_colour_gradient(limits=c(min(w$dt), max(w$dt)),low="#9999FF", high="#000066") +  geom_point(data=pt.data, color="red", size=3, aes(shape=Port))