柱状图
library(ggplot2)
ggplot(iris, aes(x = Species, y = Sepal.Length)) +
stat_summary(fun.data = "mean_se", geom = "bar")
ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
stat_summary(fun.data = "mean_se", geom = "bar", width = 0.3) +
scale_fill_manual(values = c("steelblue", "orange", "firebrick")) +
theme_bw()
2023-02-22 16:10