How do I get the correct shape and color for the points in the legend when adding geom_smooth?
If I add geom_smooth
then I end up with different colored rectangles in the shape legend instead of black circles. How can I prevent this? Here is a sample code example .
library(ggplot2)
df <- data.frame(x=rnorm(100), y=rnorm(100), z=runif(100))
qplot(x, y, size=z, data=df) +
geom_smooth(method='loess', aes(weight=z))
+3
source to share