【发布时间】:2023-01-22 16:47:41
【问题描述】:
library(ggplot2)
ggplot(mtcars) +
aes(x = mpg, y = disp, size = cyl) +
geom_point() +
geom_smooth(level = 0.99, method = "loess")
如何在图例中也有圆圈?
【问题讨论】:
library(ggplot2)
ggplot(mtcars) +
aes(x = mpg, y = disp, size = cyl) +
geom_point() +
geom_smooth(level = 0.99, method = "loess")
如何在图例中也有圆圈?
【问题讨论】:
您不应该单独添加 ads,而是可以这样做:
ggplot(mtcars, aes(x = mpg, y = disp)) +
geom_point(aes(size = cyl)) +
geom_smooth(level = 0.99, method = "loess")
【讨论】: