Here briefly summarized the process to figure visualization based on ggplot2 packages for the manuscript (doi.org/10.1101/2022.09.03.506439). 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.
Mass variation at a whole root level between sampling months (APR: April, MAY: May) and provenances (grey: Eastern provenance, white: Northern provenance). Different letters denote significant difference in each panel (p <0.05).
#package preparation
library(ggplot2)
library(patchwork)
library(lme4)
library(lmerTest)
library(lsmeans)
library(multcomp)
#Data adjustment in advance
ndata<-read.csv("/Users/sugai/Desktop/IJPS_fig2_4.csv")
ndata$id<-as.factor(ndata$id)
lndata<-ndata
lndata[,5:19]<-log(1+ndata[,5:19])
#multiple-comparison
mp1<-lmer(data=lndata,T_MAS~time*region+(1|plot)+(1|id))
mp2<-lmer(data=lndata,P_MAF~time*region+(1|plot)+(1|id))
mp3<-lmer(data=lndata,F_MAF~time*region+(1|plot)+(1|id))
mul1 <- lsmeans(mp1, specs=c("time","region"))
mul2 <- lsmeans(mp2, specs=c("time","region"))
mul3 <- lsmeans(mp3, specs=c("time","region"))
c_mp1<-as.data.frame(cld(mul1, sort=FALSE, Letters=LETTERS))
c_mp2<-as.data.frame(cld(mul2, sort=FALSE, Letters=LETTERS))
c_mp3<-as.data.frame(cld(mul3, sort=FALSE, Letters=LETTERS))
c_mp1$max<-c(80,105,90,93)
c_mp2$max<-c(1,1.9,.6,1.9)
c_mp3$max<-c(77,72,72,72)
c_mp1$.group<-c("a","a","a","a")
c_mp2$.group<-c("ab","ab","a","b")
c_mp3$.group<-c("a","a","a","a")
ndata1<-merge(ndata,c_mp1,by=c("time","region"))
ndata2<-merge(ndata,c_mp2,by=c("time","region"))
ndata3<-merge(ndata,c_mp3,by=c("time","region"))
#Visualization
f1<-ggplot()+
geom_boxplot(data=ndata1, aes(x = time, y=T_MAS,fill=region),alpha=.5)+
geom_text(data=ndata1,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata1,aes(x=time,y=T_MAS,colour=region),
stat = "summary",fun="mean", shape=17,size=5,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y="Total root drymass (g)",x="")+
theme(legend.position=c(0.53,.98),legend.justification=c(0.95,1),
legend.text = element_text(size=15,colour = "black",face="bold"),
legend.background = element_blank(),
axis.text = element_text(size=16,colour = "black"),
axis.title = element_text(size=16,colour = "black"),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,140),breaks = seq(0,150,30))+
facet_wrap(.~ndata1$region,ncol=2)
f2<-ggplot()+
geom_boxplot(data=ndata2, aes(x = time, y=P_MAF,fill=region),alpha=.5)+
geom_text(data=ndata2,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata2,aes(x=time,y=P_MAF,colour=region),
stat = "summary",fun="mean", shape=17,size=5,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y="Mass fraction of pioneer root (%)",x="")+
theme(legend.position="none",
axis.text = element_text(size=16,colour = "black"),
axis.title = element_text(size=16,colour = "black"),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
facet_wrap(.~ndata2$region,ncol=2)
f3<-ggplot()+
geom_boxplot(data=ndata3, aes(x = time, y=F_MAF,fill=region),alpha=.5)+
geom_text(data=ndata3,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata3,aes(x=time,y=F_MAF,colour=region),
stat = "summary",fun="mean", shape=17,size=5,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y="Mass fraction of fibrous root (%)",x="")+
theme(legend.position="none",
axis.text = element_text(size=16,colour = "black"),
axis.title = element_text(size=16,colour = "black"),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,100),breaks = seq(0,100,20))+
facet_wrap(.~ndata3$region,ncol=2)
(f1|f2|f3)+ plot_annotation(tag_levels = 'a', tag_prefix = '(',
tag_sep = '.', tag_suffix = ')')
Variation in the average length (a) and total root number (b) of pioneer roots between sampling months and provenances.
#Data adjustment in advance
ndata<-read.csv("/Users/sugai/Desktop/IJPS_fig5.csv")
ndata$id<-as.factor(ndata$id)
lndata<-ndata
lndata[,5:6]<-log(1+ndata[,5:6])
#multiple-comparison
mp1<-lmer(data=lndata,pavel~region*time+(1|plot)+(1|id))
mp2<-lmer(data=lndata,pnum~region*time+(1|plot)+(1|id))
mul1 <- lsmeans(mp1, specs=c("time","region"))
mul2 <- lsmeans(mp2, specs=c("time","region"))
c_mp1<-as.data.frame(cld(mul1, sort=FALSE, Letters=LETTERS))
c_mp2<-as.data.frame(cld(mul2, sort=FALSE, Letters=LETTERS))
c_mp1$max<-c(1.3,1.5,2.6,1.2)
c_mp2$max<-c(59,30,38,68)
c_mp1$.group<-c("a","a","a","a")
c_mp2$.group<-c("ab","a","b","a")
ndata1<-merge(ndata,c_mp1,by=c("time","region"))
ndata2<-merge(ndata,c_mp2,by=c("time","region"))
#Box-plot panels with letters
pm5<-ggplot()+
geom_boxplot(data=ndata1, aes(x = time, y=pavel,fill=region),alpha=.5)+
geom_text(data=ndata1,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata1,aes(x=time,y=pavel,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y="Average length of pioneer roots (cm)",x="")+
theme(legend.position=c(0.3,.97),legend.justification=c(0.95,1),
legend.text = element_text(size=12,colour = "black",face="bold"),
legend.background = element_blank(),
axis.text = element_text(size=16,colour = "black"),
axis.title = element_text(size=16,colour = "black"),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,3),breaks = seq(0,3,.5))+
facet_wrap(.~ndata1$region,ncol=2)
pw5<-ggplot()+
geom_boxplot(data=ndata2, aes(x = time, y=pnum,fill=region),alpha=.5)+
geom_text(data=ndata2,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata2,aes(x=time,y=pnum,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y="Total number of pioneer roots",x="")+
theme(legend.position="none",
axis.text = element_text(size=16,colour = "black"),
axis.title = element_text(size=16,colour = "black"),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,70),breaks = seq(0,80,10))+
facet_wrap(.~ndata2$region,ncol=2)
(pm5|pw5)+ plot_annotation(tag_levels = 'a', tag_prefix = '(',
tag_sep = '.', tag_suffix = ')')
Morphological variation between sampling months and provenances in pioneer roots (a-c) and fibrous roots (d-f), respectively. SRL: specific root length, SRA: specific root area, RTD: root tissue density.
library(ggplot2)
library(patchwork)
library(lme4)
library(lmerTest)
library(lsmeans)
library(multcomp)
library(ggtext)
#Data adjustment in advance
ndata<-read.csv("/Users/sugai/Desktop/IJPS_fig2_4.csv")
ndata$id<-as.factor(ndata$id)
lndata<-ndata
lndata[,5:19]<-log(1+ndata[,5:19])
#multiple-comparison
mp1<-lmer(data=lndata,P_SRL~time*region+(1|plot)+(1|id))
mp2<-lmer(data=lndata,P_SRA~time*region+(1|plot)+(1|id))
mp3<-lmer(data=lndata,P_RTD~time*region+(1|plot)+(1|id))
mf1<-lmer(data=lndata,F_SRL~time*region+(1|plot)+(1|id))
mf2<-lmer(data=lndata,F_SRA~time*region+(1|plot)+(1|id))
mf3<-lmer(data=lndata,F_RTD~time*region+(1|plot)+(1|id))
mul1 <- lsmeans(mp1, specs=c("time","region"))
mul2 <- lsmeans(mp2, specs=c("time","region"))
mul3 <- lsmeans(mp3, specs=c("time","region"))
mul4 <- lsmeans(mf1, specs=c("time","region"))
mul5 <- lsmeans(mf2, specs=c("time","region"))
mul6 <- lsmeans(mf3, specs=c("time","region"))
c_mp1<-as.data.frame(cld(mul1, sort=FALSE, Letters=LETTERS))
c_mp2<-as.data.frame(cld(mul2, sort=FALSE, Letters=LETTERS))
c_mp3<-as.data.frame(cld(mul3, sort=FALSE, Letters=LETTERS))
c_mf1<-as.data.frame(cld(mul4, sort=FALSE, Letters=LETTERS))
c_mf2<-as.data.frame(cld(mul5, sort=FALSE, Letters=LETTERS))
c_mf3<-as.data.frame(cld(mul6, sort=FALSE, Letters=LETTERS))
c_mp1$max<-c(13,11,9,15)
c_mp2$max<-c(330,300,290,430)
c_mp3$max<-c(0.4,0.3,0.3,0.3)
c_mf1$max<-c(40,24,36,33)
c_mf2$max<-c(570,350,440,370)
c_mf3$max<-c(0.35,0.65,0.4,0.55)
c_mp1$.group<-c("ab","ab","a","b")
c_mp2$.group<-c("ab","ab","a","b")
c_mp3$.group<-c("a","a","a","a")
c_mf1$.group<-c("a","b","ab","ab")
c_mf2$.group<-c("a","b","a","ab")
c_mf3$.group<-c("a","b","a","b")
ndata1<-merge(ndata,c_mp1,by=c("time","region"))
ndata2<-merge(ndata,c_mp2,by=c("time","region"))
ndata3<-merge(ndata,c_mp3,by=c("time","region"))
ndata4<-merge(ndata,c_mf1,by=c("time","region"))
ndata5<-merge(ndata,c_mf2,by=c("time","region"))
ndata6<-merge(ndata,c_mf3,by=c("time","region"))
#Box-plot panels with letters
ylab<-"SRL<br>
of pioneer roots (m g<sup>-1</sup>)"
pm1<-ggplot()+
geom_boxplot(data=ndata1, aes(x = time, y=P_SRL,fill=region),alpha=.5)+
geom_text(data=ndata1,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata1,aes(x=time,y=P_SRL,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position=c(0.6,.97),legend.justification=c(0.95,1),
legend.text = element_text(size=12,colour = "black",face="bold"),
legend.background = element_blank(),
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=13,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,50),breaks = seq(0,50,10),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata1$region,ncol=2)
ylab<-"SRA<br>
of pioneer roots (cm<sup>2</sup> g<sup>-1</sup>)"
pm2<-ggplot()+
geom_boxplot(data=ndata2, aes(x = time, y=P_SRA,fill=region),alpha=.5)+
geom_text(data=ndata2,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata2,aes(x=time,y=P_SRA,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab ,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=13,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,600),breaks = seq(0,600,200),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata2$region,ncol=2)
ylab<-"RTD<br>
of pioneer roots (g cm<sup>-3</sup>)"
pm3<-ggplot()+
geom_boxplot(data=ndata3, aes(x = time, y=P_RTD,fill=region),alpha=.5)+
geom_text(data=ndata3,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata2,aes(x=time,y=P_RTD,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab ,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=13,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,.8),breaks = seq(0,.8,.2),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata3$region,ncol=2)
ylab<-"SRL<br>
of fibrous roots (m g<sup>-1</sup>)"
fm1<-ggplot()+
geom_boxplot(data=ndata4, aes(x = time, y=F_SRL,fill=region),alpha=.5)+
geom_text(data=ndata4,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata4,aes(x=time,y=F_SRL,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=13,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,50),breaks = seq(0,50,10),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata4$region,ncol=2)
ylab<-"SRA<br>
of fibrous roots (cm<sup>2</sup> g<sup>-1</sup>)"
fm2<-ggplot()+
geom_boxplot(data=ndata5, aes(x = time, y=F_SRA,fill=region),alpha=.5)+
geom_text(data=ndata5,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata5,aes(x=time,y=F_SRA,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=13,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,600),breaks = seq(0,600,200),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata5$region,ncol=2)
ylab<-"RTD<br>
of fibrous roots (g cm<sup>-3</sup>)"
fm3<-ggplot()+
geom_boxplot(data=ndata6, aes(x = time, y=F_RTD,fill=region),alpha=.5)+
geom_text(data=ndata6,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata6,aes(x=time,y=F_RTD,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=13,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm"),
plot.margin= unit(c(1, 1, 1, 1), "lines")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,.8),breaks = seq(0,.8,.2),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata6$region,ncol=2)
all<-(pm1/pm2/pm3)|(fm1/fm2/fm3)
all+ plot_annotation(tag_levels = 'a', tag_prefix = '(',
tag_sep = '.', tag_suffix = ')')
Average diameter and structural variation between sampling months and provenances in pioneer roots (a-c) and fibrous roots (d-f), respectively.
#Data adjustment in advance
ndata<-read.csv("/Users/sugai/Desktop/IJPS_fig2_4.csv")
ndata$id<-as.factor(ndata$id)
lndata<-ndata
lndata[,5:19]<-log(1+ndata[,5:19])
#multiple-comparison
mp1<-lmer(data=lndata,P_AD~time*region+(1|plot)+(1|id))
mp2<-lmer(data=lndata,P_CC~time*region+(1|plot)+(1|id))
mp3<-lmer(data=lndata,P_CE~time*region+(1|plot)+(1|id))
mf1<-lmer(data=lndata,F_AD~time*region+(1|plot)+(1|id))
mf2<-lmer(data=lndata,F_CC~time*region+(1|plot)+(1|id))
mf3<-lmer(data=lndata,F_CE~time*region+(1|plot)+(1|id))
mul1 <- lsmeans(mp1, specs=c("time","region"))
mul2 <- lsmeans(mp2, specs=c("time","region"))
mul3 <- lsmeans(mp3, specs=c("time","region"))
mul4 <- lsmeans(mf1, specs=c("time","region"))
mul5 <- lsmeans(mf2, specs=c("time","region"))
mul6 <- lsmeans(mf3, specs=c("time","region"))
c_mp1<-as.data.frame(cld(mul1, sort=FALSE, Letters=LETTERS))
c_mp2<-as.data.frame(cld(mul2, sort=FALSE, Letters=LETTERS))
c_mp3<-as.data.frame(cld(mul3, sort=FALSE, Letters=LETTERS))
c_mf1<-as.data.frame(cld(mul4, sort=FALSE, Letters=LETTERS))
c_mf2<-as.data.frame(cld(mul5, sort=FALSE, Letters=LETTERS))
c_mf3<-as.data.frame(cld(mul6, sort=FALSE, Letters=LETTERS))
c_mp1$max<-c(1.8,1.8,2,1.8)
c_mp2$max<-c(72,69,80,64)
c_mp3$max<-c(53,53,53,53)
c_mf1$max<-c(0.75,0.75,0.75,0.75)
c_mf2$max<-c(67,67,72,72)
c_mf3$max<-c(66,57,57,60)
c_mp1$.group<-c("a","a","a","a")
c_mp2$.group<-c("ab","ac","b","c")
c_mp3$.group<-c("a","a","a","a")
c_mf1$.group<-c("a","a","a","a")
c_mf2$.group<-c("a","a","a","a")
c_mf3$.group<-c("a","a","a","a")
ndata1<-merge(ndata,c_mp1,by=c("time","region"))
ndata2<-merge(ndata,c_mp2,by=c("time","region"))
ndata3<-merge(ndata,c_mp3,by=c("time","region"))
ndata4<-merge(ndata,c_mf1,by=c("time","region"))
ndata5<-merge(ndata,c_mf2,by=c("time","region"))
ndata6<-merge(ndata,c_mf3,by=c("time","region"))
#Box-plot panels with letters
ylab<-"Average diameter<br>
of pioneer roots (mm)"
pm1<-ggplot()+
geom_boxplot(data=ndata1, aes(x = time, y=P_AD,fill=region),alpha=.5)+
geom_text(data=ndata1,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata1,aes(x=time,y=P_AD,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position=c(0.55,1.05),legend.justification=c(0.95,1),
legend.text = element_text(size=12,colour = "black",face="bold"),
legend.background = element_blank(),
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=14,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0.5,2.4),breaks = seq(0,2.4,.5),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata1$region,ncol=2)
ylab<-"Central cylinder<br>
of pioneer roots (%)"
pm2<-ggplot()+
geom_boxplot(data=ndata2, aes(x = time, y=P_CC,fill=region),alpha=.5)+
geom_text(data=ndata2,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata2,aes(x=time,y=P_CC,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=14,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,100),breaks = seq(0,100,20),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata2$region,ncol=2)
ylab<-"Cortex<br>
of pioneer roots (%)"
pm3<-ggplot()+
geom_boxplot(data=ndata3, aes(x = time, y=P_CE,fill=region),alpha=.5)+
geom_text(data=ndata3,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata3,aes(x=time,y=P_CE,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=14,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,100),breaks = seq(0,100,20),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata3$region,ncol=2)
ylab<-"Average diameter<br>
of fibrous roots (mm)"
fm1<-ggplot()+
geom_boxplot(data=ndata4, aes(x = time, y=F_AD,fill=region),alpha=.5)+
geom_text(data=ndata4,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata4,aes(x=time,y=F_AD,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=14,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0.5,2.4),breaks = seq(0,2.4,.5),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata4$region,ncol=2)
ylab<-"Central cylinder<br>
of fibrous roots (%)"
fm2<-ggplot()+
geom_boxplot(data=ndata5, aes(x = time, y=F_CC,fill=region),alpha=.5)+
geom_text(data=ndata5,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata5,aes(x=time,y=F_CC,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=14,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,100),breaks = seq(0,100,20),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata5$region,ncol=2)
ylab<-"Cortex<br>
of fibrous roots (%)"
fm3<-ggplot()+
geom_boxplot(data=ndata6, aes(x = time, y=F_CE,fill=region),alpha=.5)+
geom_text(data=ndata6,aes(x=time,y=max,label=.group),
size = rel(5), color = "black", fontface = "bold")+
geom_point(data=ndata6,aes(x=time,y=F_CE,colour=region),
stat = "summary",fun="mean", shape=17,size=3,
position = position_dodge(width =.75))+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF"),
labels = c("ER" = "Eastern provenance",
"NR" ="Northern provenance") )+
scale_colour_manual(values=c("#000000","#000000"))+
theme_classic()+
labs(y=ylab,x="")+
theme(legend.position="none",
axis.text = element_text(size=12,colour = "black"),
axis.title.y.left = element_textbox_simple(
size=14,orientation = "left-rotated", halign = 0.5,lineheight =1),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
guides(fill = guide_legend(title = NULL),color = guide_none(),x.sec = "axis", y.sec = "axis")+
scale_y_continuous(limits = c(0,100),breaks = seq(0,100,20),labels = function(x) formatC(x, width = 5))+
facet_wrap(.~ndata6$region,ncol=2)
all<-(pm1/pm2/pm3)|(fm1/fm2/fm3)
all+plot_annotation(tag_levels = 'a', tag_prefix = '(',
tag_sep = '.', tag_suffix = ')')
Morphological variation between sampling months and growing sites in fibrous roots of seedlings originating from eastern provenance, respectively. SRL: specific root length, SRA: specific root area, RTD: root tissue density.
library(ggplot2)
library(patchwork)
library(lme4)
library(lmerTest)
library(lsmeans)
library(multcomp)
#Data adjustment in advance
rawdata<-read.csv("/Users/sugai/Desktop/IJPS_figSup.csv")
ndata<-na.omit(rawdata)
#Box-plot panels with letters
fm1<-ggplot(ndata, aes(x = tag, y=F_SRL,fill=tag))+
geom_boxplot()+
geom_point(data=ndata,mapping=aes(x=tag,y=F_SRL),
stat = "summary",fun="mean", shape=23,size=3,colour="black",fill="white",
position = position_dodge(width =.75))+
scale_x_discrete(labels = c("ER_BBI" = "Common garden \n in April",
"ER_ER" ="Eastern site \n in April",
"ER_MAY"="Common garden \n in May") )+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF","#000000"))+
theme_classic()+
labs(y=expression(paste( "SRL (m ", {g^-1}, ")" )),x="")+
theme(legend.position="none",
axis.text = element_text(hjust = .5, size = 16,colour="black"),
axis.title = element_text(hjust = .5, size = 16,colour="black"),
plot.title = element_text(size=16),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
scale_y_continuous(limits = c(0,50),breaks = seq(0,50,10))+
guides(x.sec = "axis", y.sec = "axis")
fm2<-ggplot(ndata, aes(x = tag, y=F_SRA,fill=tag))+
geom_boxplot()+
geom_point(data=ndata,mapping=aes(x=tag,y=F_SRA),
stat = "summary",fun="mean", shape=23,size=3,colour="black",fill="white",
position = position_dodge(width =.75))+
scale_x_discrete(labels = c("ER_BBI" = "Common garden \n in April",
"ER_ER" ="Eastern site \n in April",
"ER_MAY"="Common garden \n in May") )+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF","#000000"))+
theme_classic()+
labs(y=expression( paste( "SRA (", {cm^2}," ",{ g^-1}, ")" ) ),x="")+
theme(legend.position="none",
axis.text = element_text(hjust = .5, size = 16,colour="black"),
axis.title = element_text(hjust = .5, size = 16,colour="black"),
plot.title = element_text(size=16),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
scale_y_continuous(limits = c(0,600),breaks = seq(0,600,200))+
guides(x.sec = "axis", y.sec = "axis")
fm3<-ggplot(ndata, aes(x = tag, y=F_RTD,fill=tag))+
geom_boxplot()+
geom_point(data=ndata,mapping=aes(x=tag,y=F_RTD),
stat = "summary",fun="mean", shape=23,size=3,colour="black",fill="white",
position = position_dodge(width =.75))+
scale_x_discrete(labels = c("ER_BBI" = "Common garden \n in April",
"ER_ER" ="Eastern site \n in April",
"ER_MAY"="Common garden \n in May") )+
scale_fill_manual(values=c("#A9A9A9","#FFFFFF","#000000"))+
theme_classic()+
labs(y=expression(paste( "RTD (", {g}," ",{cm^-3}, ")" )),x="")+
theme(legend.position="none",
axis.text = element_text(hjust = .5, size = 16,colour="black"),
axis.title = element_text(hjust = .5, size = 16,colour="black"),
plot.title = element_text(size=16),
axis.text.x.top = element_blank(),
axis.text.y.right = element_blank(),
axis.ticks.x.top = element_blank(),
axis.ticks.y.right = element_blank(),
strip.background = element_blank(),
strip.text = element_blank(),
axis.line.x.top = element_line(),
axis.line.x.bottom = element_line(),
axis.line.y.left = element_line(),
axis.line.y.right = element_line(),
panel.spacing = unit(0, "cm")
)+
scale_y_continuous(limits = c(0,.6),breaks = seq(0,.6,.2))+
guides(x.sec = "axis", y.sec = "axis")
(fm1/fm2/fm3)+ plot_annotation(tag_levels = 'a', tag_prefix = '(',
tag_sep = '.', tag_suffix = ')')