inst/examples/stripchart2.R

# ggplo2 绘制各种杀虫剂下昆虫数目的带状图
library(ggplot2)
data(InsectSprays)
p = ggplot(InsectSprays, aes(spray, count, color = spray)) +
  geom_boxplot(outlier.shape = NA) +
  geom_jitter(shape = 0) +
  labs(x = "杀虫剂", y = "频数") +
  theme(legend.position = "") +
  coord_flip()
print(p)
yihui/MSG documentation built on Aug. 16, 2021, 12:13 p.m.