g <- ggplot(df2,aes(x = A, y =`DOC(mg kg-1)` ,fill= B))+
geom_split_violin(trim =F,color = NA,adjust = 1.5)+
guides(fill=guide_legend(title="group"))+
stat_summary(fun.data = "mean_sd",position=position_dodge(0.15),geom = "errorbar",width = .1) +
stat_summary(fun = "mean", geom = "point", position=position_dodge(0.15),show.legend = F)+
stat_compare_means(aes(group = B), label = "p.signif",label.y=210, method="t.test",size=5)+
scale_fill_manual(values=c("#788FCE","#E6956F"))+
labs(x=NULL,y="DOC(mg kg-1)")+
theme(
axis.text.x=element_text(angle =0,hjust =0.5,vjust =0.5,color="black",size = 10,margin = margin(b =2)),
axis.text.y=element_text(color="black",size = 10,margin = margin(r =1)),
panel.background = element_rect(fill = NA,color = NA),
panel.grid.minor= element_line(size=0.2,color="#e5e5e5"),
panel.grid.major = element_line(size=0.2,color="#e5e5e5"),
panel.border = element_rect(fill=NA,color="black",size=1,linetype="solid"),
legend.position ="non")
df3 <- read_tsv("F1BC.txt") %>%
select(2,3,-1) %>%
separate(`Treatment`,into=c("A","B"),sep="-",convert = T) %>%
mutate(B = str_replace_all(B, "[0-9]", ""))
df3$A <- factor(df3$A,levels = c("Conven","Conserv"))
b <- ggplot(df3,aes(x = A, y =`Soil temperate (℃)`,fill= B))+
geom_split_violin(trim =F,color = NA,adjust = 1.5)+
guides(fill=guide_legend(title="group"))+
stat_summary(fun.data = "mean_sd",position=position_dodge(0.15),geom = "errorbar",width = .1) +
stat_summary(fun = "mean", geom = "point", position=position_dodge(0.15),show.legend = F)+
stat_compare_means(aes(group = B), label = "p.signif",label.y=17.1, method="t.test",size=5)+
scale_fill_manual(values=c("#788FCE","#E6956F")) +
labs(x=NULL,y="Soil temperate")+
theme(
axis.text.x=element_text(angle =0,hjust =0.5,vjust =0.5,color="black",size = 10,margin = margin(b =2)),
axis.text.y=element_text(color="black",size = 10,margin = margin(r =1)),
panel.background = element_rect(fill = NA,color = NA),
panel.grid.minor= element_line(size=0.2,color="#e5e5e5"),
panel.grid.major = element_line(size=0.2,color="#e5e5e5"),
panel.border = element_rect(fill=NA,color="black",size=1,linetype="solid"),
legend.position ="non")