美文网首页ggplot集锦
重现已有的图标Fig3-d 带显著性差异标志的箱线图box pl

重现已有的图标Fig3-d 带显著性差异标志的箱线图box pl

作者: RashidinAbdu | 来源:发表于2022-04-17 13:13 被阅读0次

    数据准备与格式:

    读取数据

    d<-read.csv(file.choose())
    d
    

    导入需要的包:

    library(ggplot2)
    library(ggthemr)   
    library(ggpubr)
    ggthemr("flat") 
    

    进行绘图与修饰:

    fig3d <- ggplot(d, aes(Interactions, Fold, fill = Interactions)) + geom_boxplot()  
    
    fig3d <-fig3d +geom_signif(comparisons = compaired, step_increase = 0.3, map_signif_level = F, test = wilcox.test)
    
    fig3d <-fig3d +stat_compare_means(comparisons = compaired)
    
    fig3d <-fig3d + stat_compare_means(label.y =0.65, label.x = 1.5) 
    
    fig3d <-fig3d+ theme_bw()+ggtitle("Average growth fold change in co-cultures") +theme(plot.title = element_text(hjust = 0.5))
    
    fig3d <-fig3d+theme(legend.position='none')
    
    fig3d <-fig3d +theme(axis.title.x = element_blank())
    
    fig3d
    

    得到:

    image.png

    如果需要,可以进行组合:

    library(ggpubr)#加载包
    fig3final<-ggarrange(fig3b,fig3d,fig3e,labels = c("b","d","e", ncol=1,nrow=3))
    fig3final
    
    image.png

    相关文章

      网友评论

        本文标题:重现已有的图标Fig3-d 带显著性差异标志的箱线图box pl

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