这里是所有的点,分开使用position_jitterdodge()和美学填充。 代码语言:javascript 复制 ggplot()+geom_point(data=d,aes(x=x,y=y,fill=color.var),position=position_jitterdodge(dodge.width=dw),size=3,alpha=1,shape=21,color='darkgray')+facet_wrap(~facet.var)+scale_fill_manual(values=c('lightblu...
在p1中,点不仅抖动,而且还被factor(wt)闪避。如果只需要抖动,请在position_jitterdodge中设置dodge....
geom_jitter(data=df1,aes(x=group,y=y,color=x), position = position_jitterdodge(0.2)) 1. 2. 3. 4. 5. 6. 7. 8. image.png
"B","A","A","A","B","B","B"),y=c(1,1,1,4,5,6,1,2,3,4,5,6),group=c("G1","G1","G1","G1","G1","G1","G2","G2","G2","G2","G2","G2"))library(ggplot2)ggplot()+geom_jitter(data=df1,aes(x=group,y=y,color=x),position=position_jitterdodge(0.2...