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)

Try the MSG package in your browser

Any scripts or data that you put into this service are public.

MSG documentation built on July 22, 2021, 1:06 a.m.