美文网首页
Fig3-d 箱图的绘制 2020-12-17

Fig3-d 箱图的绘制 2020-12-17

作者: RashidinAbdu | 来源:发表于2022-04-20 11:53 被阅读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 箱图的绘制 2020-12-17

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