绘图功能片段

2022-12-09  本文已影响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")  
上一篇下一篇

猜你喜欢

热点阅读