library(ggplot2) ggplot(mtcars) + aes(x = mpg, y = disp, size = cyl) + geom_point() + geom_smooth(level = 0.99, method = "loess")
如您所见,图表中有 * 圆圈 *,但图例中有 * 矩形 *。如何在图例中也有圆?
68bkxrlz1#
您不应该单独添加aes,而是可以执行以下操作:
aes
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'
1条答案
按热度按时间68bkxrlz1#
您不应该单独添加
aes
,而是可以执行以下操作: