ggplot(mpg, aes(class, hwy)) + geom_boxplot(notch = TRUE, outlier.colour = "red", outlier.shape = 6, outlier.size = 3) + theme_bw() 6. 将均值点加入mean 函数stat_summary() 可用于将平均点添加到箱线图中: ggplot(mpg, aes(class, hwy)) + geom_boxplot() + stat_summary(fun.y ...