# ggplot2 盒图添加显著性线
1 compire <- list(c('1','2'),c('1','4')) 2 ggplot(info,aes(x=cluster,y=value))+ 3 stat_boxplot(geom = 'errorbar',width=0.2,lwd=2)+ 4 geom_boxplot(lwd=1)+ 5 geom_signif(comparisons = compire,test = t.test,step_increase = 0.1,map_signif_level = T,size = 1.5,textsize = 10,vjust = 0.5,color='black')+ 6 geom_jitter(position=position_jitter(0.2),lwd=3,shape=19,aes(color=cluster))+ 7 scale_color_manual(values=c("#374E55FF","#DF8F44FF","#00A1D5FF","#B24745FF"))+ 8 theme_classic()+ 9 theme(axis.text = element_text(size=30,color = 'black'),axis.title.y = element_text(size = 30),legend.position="none",plot.title = element_text(hjust = 0.5,size = 25)) + xlab('') + ylab('')+ 10 ggtitle('Demo')