美文网首页
绘图功能片段

绘图功能片段

作者: 郭师傅 | 来源:发表于2022-12-09 08:21 被阅读0次

    箱线图 boxplot,一行两列图

    library(ggpubr)
    p1 <- ggboxplot(cvs, x="group", y="cv", color = "group", 
              palette = "jco", add = "jitter")+     #添加p-valuep
              stat_compare_means()
    
    
    p2 <- ggboxplot(cvs, x="group", y="sbpcv", color = "group", 
              palette = "jco", add = "jitter")+     #添加p-valuep
              stat_compare_means()
    
    box <- cowplot::plot_grid(plotlist = list(p1,p2),labels = "AUTO")
    box
    ggsave(plot = box,
           filename = "box.jpg",
           width = 18,height = 9,units = "cm")  
    

    相关分析图

    library(ggstatsplot)
    a <- ggscatterstats(data = cvs %>% select(cv,sbpcv) ,
                                        x = "cv",
                                        y = "sbpcv"
    )
    ggsave(plot = a,
                  filename = "pcv_sbpdv.jpg",
                  width = 15,height = 9,units = "cm")  
    

    相关文章

      网友评论

          本文标题:绘图功能片段

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