Here briefly summarized the process to figure visualization based on ggplot2 packages for the manuscript (in prep). Note the descriptions may be updated at any time, and there is concern that they may contain incomplete and redundant code.The data used are not published online, but may be shared by contacting the corresponding author.
Variation in response of dry mass to saline treatment among three larch species. Orange boxes and dotes denote the value at control, and blue at saline treatment.
#package preparation
library(ggplot2)
library(patchwork)
#data input
ps<-read.csv("/Users/sugai/Desktop/ps_dataset.csv")
ps1<-ps[,c(1:2,7:11,13:14,16:18,20:22,24:26,28:30,32:34,36)]
ps1<-transform(ps1,sp=factor(sp,levels=c("DL","JL","HL")))
sub1 <- ~ paste(italic("L. gmelinii"))
sub2 <- ~ paste("Hybrid larch")
sub3 <- ~ paste(italic("L. kaempferi"))
a<-ggplot(data=ps1,aes(x=sp,y=whole,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Whole plant dry mass (g)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,15),breaks=seq(0,15,5))+
guides(colour=guide_legend(title=NULL))
b<-ggplot(data=ps1,aes(x=sp,y=main,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Total dry mass of tap root (g)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,2),breaks=seq(0,2,.5))+
guides(colour=guide_legend(title=NULL))
c<-ggplot(data=ps1,aes(x=sp,y=wood,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Total dry mass of secondary roots (g)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,3),breaks=seq(0,3,1))+
guides(colour=guide_legend(title=NULL))
d<-ggplot(data=ps1,aes(x=sp,y=fine,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Total dry mass of primary roots (g)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,5),breaks=seq(0,5,1))+
guides(colour=guide_legend(title=NULL))
res<-(a|b)/(c|d)+ plot_layout(guides = "collect")& theme(legend.position = "bottom")
res+plot_annotation(tag_levels = 'a', tag_prefix = '(',tag_sep = '.', tag_suffix = ')')
###Figure 2 Variation in morphological response of each root to saline treatment among three larch species.
#package preparation
library(ggplot2)
library(patchwork)
#data input
ps<-read.csv("/Users/sugai/Desktop/ps_dataset.csv")
ps1<-ps[,c(1:2,7:11,13:14,16:18,20:22,24:26,28:30,32:34,36)]
ps1<-transform(ps1,sp=factor(sp,levels=c("DL","JL","HL")))
sub1 <- ~ paste(italic("L. gmelinii"))
sub2 <- ~ paste("Hybrid larch")
sub3 <- ~ paste(italic("L. kaempferi"))
e<-ggplot(data=ps1,aes(x=sp,y=t_len,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Total length of tap root (cm)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,10),breaks=seq(0,10,2))+
guides(colour=guide_legend(title=NULL))
f<-ggplot(data=ps1,aes(x=sp,y=w_len,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Total length of secondary roots (cm)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,8),breaks=seq(0,8,2))+
guides(colour=guide_legend(title=NULL))
g<-ggplot(data=ps1,aes(x=sp,y=p_len/100,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y="Total length of primary roots (m)")+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,100),breaks=seq(0,100,20))+
guides(colour=guide_legend(title=NULL))
h<-ggplot(data=ps1,aes(x=sp,y=t_are,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y=expression(paste("Total area of tap root (",{cm^2},")")) )+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,400),breaks=seq(0,400,100))+
guides(colour=guide_legend(title=NULL))
i<-ggplot(data=ps1,aes(x=sp,y=w_are,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y=expression(paste("Total area of secondary roots (",{cm^2},")")) )+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,200),breaks=seq(0,200,50))+
guides(colour=guide_legend(title=NULL))
j<-ggplot(data=ps1,aes(x=sp,y=p_are/10000,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y=expression(paste("Total area of primary roots (",{m^2},")")) )+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,8),breaks=seq(0,8,2))+
guides(colour=guide_legend(title=NULL))
res<-(e|f|g)/(h|i|j)+ plot_layout(guides = "collect")& theme(legend.position = "bottom")
res+plot_annotation(tag_levels = 'a', tag_prefix = '(',tag_sep = '.', tag_suffix = ')')
###Figure 3 Variation in response of Na concentration to saline treatment among three larch species.
#package preparation
library(ggplot2)
library(patchwork)
#data input
ps<-read.csv("/Users/sugai/Desktop/ps_dataset.csv")
ps1<-ps[,c(1:2,7:11,13:14,16:18,20:22,24:26,28:30,32:34,36)]
ps1<-transform(ps1,sp=factor(sp,levels=c("DL","JL","HL")))
sub1 <- ~ paste(italic("L. gmelinii"))
sub2 <- ~ paste("Hybrid larch")
sub3 <- ~ paste(italic("L. kaempferi"))
A<-ggplot(data=ps1,aes(x=sp,y=t_nac,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y=expression(paste("Na concentration of tap root (mg ",{g^-1},")")) )+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,1.2),breaks=seq(0,1.2,.4))+
guides(colour=guide_legend(title=NULL))
B<-ggplot(data=ps1,aes(x=sp,y=w_nac,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y=expression(paste("Na concentration of secondary roots (mg ",{g^-1},")")) )+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,5),breaks=seq(0,5,1))+
guides(colour=guide_legend(title=NULL))
C<-ggplot(data=ps1,aes(x=sp,y=p_nac,colour=tre))+
geom_boxplot(outlier.shape=NA)+
geom_jitter(position=position_jitterdodge(jitter.width = .1),size=3,alpha=.5)+
theme_classic(base_family = "Times New Roman")+
labs(x="",y=expression(paste("Na concentration of primary roots (mg ",{g^-1},")")) )+
scale_x_discrete(labels=c(sub1,sub3,sub2))+
scale_color_manual(labels=c("Control","Salt"),values=c("#ffa31a","#0072b5"))+
theme(legend.position = "bottom",legend.direction = "horizontal",
axis.text = element_text(size=rel(1.2),colour="black"),
axis.title = element_text(size=rel(1.2),colour="black"),
legend.text = element_text(size=rel(1.5),colour="black"),
legend.margin=margin(t=-20))+
scale_y_continuous(limits = c(0,5),breaks=seq(0,5,1))+
guides(colour=guide_legend(title=NULL))
res<-(A|B|C)+ plot_layout(guides = "collect")& theme(legend.position = "bottom")
res+plot_annotation(tag_levels = 'a', tag_prefix = '(',tag_sep = '.', tag_suffix = ')')