1. ggbeeswarm
https://www.jianshu.com/p/ece7e53a41b2
所需R包:
ggplot2
,ggbeeswarm
ggplot()+geom_beeswarm(data=, aes(x=, y=, color=), size=, priority=, cex=)
size=
: 点的大小
priority=
: 点的排列方式,有ascending
,descending
,density
,random
和none
五种
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() '#示例一
示例一
网友评论