inst/examples/insects-boxplot2.R

# ggplot2 绘制昆虫数目箱线图
data(InsectSprays)
library(ggplot2)
p = ggplot(aes(y = count, x = spray), data = InsectSprays) +
  geom_boxplot(outlier.shape = 4) +
  labs(x = "杀虫剂", y = "频数") +
  coord_flip()
print(p)
yihui/MSG documentation built on Aug. 16, 2021, 12:13 p.m.