美文网首页
ggplot2: 蜂群图

ggplot2: 蜂群图

作者: LET149 | 来源:发表于2023-06-14 20:36 被阅读0次

1. ggbeeswarm

https://www.jianshu.com/p/ece7e53a41b2

所需R包:ggplot2, ggbeeswarm

ggplot()+geom_beeswarm(data=, aes(x=, y=, color=), size=, priority=, cex=)

    1. size= : 点的大小
    1. priority= : 点的排列方式,有ascending, descending, density, randomnone五种
    1. cex= : 调节每群点的宽度
kk <- as.data.frame(list(aa=rnorm(1000),bb=rep(1:5,200),cc=rep(c("male","female"),500)))

ggplot()+geom_beeswarm(data=kk, aes(x=bb, y=aa, color=cc), size=2, priority = c("ascending"), cex=1)+theme_classic()   '#示例一
示例一

相关文章

网友评论

      本文标题:ggplot2: 蜂群图

      本文链接:https://www.haomeiwen.com/subject/raaxzltx.html