boxplot(weight ~ group,
data = PlantGrowth, col = "lightgray",
notch = FALSE, varwidth = TRUE
)
# 类似 boxplot
ggplot(data = PlantGrowth, aes(x = group, y = weight)) +
geom_boxplot(notch = FALSE, varwidth = TRUE, fill = "lightgray")
# 默认调色板
ggplot(data = PlantGrowth, aes(x = group, y = weight, fill = group)) +
geom_boxplot(notch = FALSE, varwidth = TRUE)
# Google 调色板
ggplot(data = PlantGrowth, aes(x = group, y = weight, fill = group)) +
geom_boxplot(notch = FALSE, varwidth = TRUE) +
scale_fill_manual(values = c("#4285f4", "#34A853", "#FBBC05", "#EA4335"))