# Figure_04: root and root+rhizosheath distrbituion rm(list = ls(all=TRUE)) library(plotrix) library(ggplot2) library(RColorBrewer) dark = brewer.pal(8,"Dark2") blues = brewer.pal(8,"Blues") set1 = brewer.pal(9,"Set1") pas1 = brewer.pal(9,"Pastel1") #my.data <- read.csv("dt_root.csv") my.data <- read.csv("../data/dt_root.csv") my.data$depth = my.data$depth *10 # data processing # root distribution [g] along the depth [cm] names(my.data) <- c("ID","pl","side","depth","rhizo","rhizo.frac") my.data$no = my.data$pl my.data$pl <- factor(my.data$pl, levels = c("1", "2", "4","5","7","8"), labels = c("C1", "C1","D","D", "C2","C2")) temp <- my.data[order(my.data$pl, my.data$side),] my.data$cum <- ave(my.data$rhizo.frac, my.data$side,my.data$pl, FUN=cumsum) #calculate cummulative root distribution my.data$pair <- factor(paste0(as.character(my.data$pl),".",as.character(my.data$side)),levels = c("C1.l","C1.r","C2.l","C2.r","D.l","D.r")) my.data$pair.d <- factor(paste0(as.character(my.data$pair),".", ifelse(my.data$depth >8, ifelse(my.data$depth > 18, "b", "m"), "t" ))) C1La = my.data[my.data$pair=="C1.l" & my.data$no==1, ] C1Ra = my.data[my.data$pair=="C1.r" & my.data$no==1, ] DLa = my.data[my.data$pair=="D.l" & my.data$no==4, ] DRa = my.data[my.data$pair=="D.r" & my.data$no==4, ] C2La = my.data[my.data$pair=="C2.l" & my.data$no==7, ] C2Ra = my.data[my.data$pair=="C2.r" & my.data$no==7, ] C1Lb = my.data[my.data$pair=="C1.l" & my.data$no==2, ] C1Rb = my.data[my.data$pair=="C1.r" & my.data$no==2, ] DLb = my.data[my.data$pair=="D.l" & my.data$no==5, ] DRb = my.data[my.data$pair=="D.r" & my.data$no==5, ] C2Lb = my.data[my.data$pair=="C2.l" & my.data$no==8, ] C2Rb = my.data[my.data$pair=="C2.r" & my.data$no==8, ] pdf("../Fig_04.pdf",height =2.8*1.2,width=3.4*1.2) par(oma=c(0.,2,0.,0), mar=c(2.2,0.5,0.5,0.5), cex=1, las=1) m=matrix(1:6,ncol=3,byrow=TRUE); layout(m) plot(NA, xlim=c(0,0.36), ylim=c(260,0),yaxs='i', xaxs='i',axes=FALSE, ylab="", xlab="") polygon(c(-1,rep(DLb$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[2]) polygon(c(-1,rep(DRb$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[1]) box() axis(1, las=0, at = c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), labels=100*c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), tck=0.04, mgp=c(3, .0, 0)) axis(2, tck=0.04, mgp=c(3, .2, 0)) text(0.18,20,'(a)', font=2, cex=1.5, adj=0) legend('right', c("Wet", "Dry"), lty=1, lwd=2, col = set1[2:1], bty='n') # C1 plot(NA, xlim=c(0,0.36), ylim=c(260,0),yaxs='i', xaxs='i',axes=FALSE, ylab="", xlab="") polygon( c(-1,rep(C1Lb$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[2]) polygon( c(-1,rep(C1Rb$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[1]) box() axis(1, las=0, at = c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), labels=100*c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), tck=0.04, mgp=c(3, .0, 0)) legend('right', c("Wet", "Dry"), lty=1, lwd=2, col = set1[2:1], bty='n') text(0.18,20,'(b)', font=2, cex=1.5, adj=0) mtext('Root Mass (% in each 20 mm layer)', side=1, line= 1, cex=0.75, las=0, font=2, outer=FALSE) # C2 plot(NA, xlim=c(0,0.36), ylim=c(260,0),yaxs='i', xaxs='i',axes=FALSE, ylab="", xlab="") polygon( c(-1,rep(C2Lb$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[2]) polygon( c(-1,rep(C2Rb$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[1]) box() axis(1, las=0, at = c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), labels=100*c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), tck=0.04, mgp=c(3, .0, 0)) legend('right', c("Left", "Right"), lty=1, lwd=2, col = set1[2:1], bty='n') text(0.18,20,'(c)', font=2, cex=1.5, adj=0) plot(NA, xlim=c(0,0.36), ylim=c(260,0),yaxs='i', xaxs='i',axes=FALSE, ylab="", xlab="") polygon(c(-1,rep(DLa$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[2]) polygon(c(-1,rep(DRa$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[1]) box() axis(1, las=0, at = c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), labels=100*c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), tck=0.04, mgp=c(3, .0, 0)) axis(2, tck=0.04, mgp=c(3, .2, 0)) text(0.18,20,'(d)', font=2, cex=1.5, adj=0) # C1 plot(NA, xlim=c(0,0.36), ylim=c(260,0),yaxs='i', xaxs='i',axes=FALSE, ylab="", xlab="") polygon( c(-1,rep(C1La$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[2]) polygon( c(-1,rep(C1Ra$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[1]) box() axis(1, las=0, at = c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), labels=100*c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), tck=0.04, mgp=c(3, .0, 0)) text(0.18,20,'(e)', font=2, cex=1.5, adj=0) mtext('Root + Rhizosheath Mass (% in each 20 mm layer)', side=1, line= 1, cex=0.75, las=0, font=2, outer=FALSE) # C2 plot(NA, xlim=c(0,0.36), ylim=c(260,0),yaxs='i', xaxs='i',axes=FALSE, ylab="", xlab="") polygon( c(-1,rep(C2La$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[2]) polygon( c(-1,rep(C2Ra$rhizo.frac,each=2),-1), 10*c(0,0, rep(seq(2,26,2),each=2)), lty=1, lwd=1, col = NA, border=set1[1]) box() axis(1, las=0, at = c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), labels=100*c(0, 0.1, 0.20, 0.3, 0.4, 0.5, 0.6), tck=0.04, mgp=c(3, .0, 0)) text(0.18,20,'(f)', font=2, cex=1.5, adj=0) mtext('Soil Depth (mm)', side=2, line= 1, cex=0.75, las=0, font=2, outer=TRUE) dev.off()