library(ggplot2)
ggplot(mtcars)
aes(x = mpg, y = disp, size = cyl)
geom_point()
geom_smooth(level = 0.99, method = "loess")
As you can see there are circles in the charts, but there are rectangles in the legend.
How to have circles in the legend as well?
CodePudding user response:
You should not add aes
separately, instead you can do this:
library(ggplot2)
ggplot(mtcars, aes(x = mpg, y = disp))
geom_point(aes(size = cyl))
geom_smooth(level = 0.99, method = "loess")
#> `geom_smooth()` using formula = 'y ~ x'