#load data & libaries library(smatr) # rm(list=ls()) # data4 <- read.csv('Trait data, 5-2-2014.csv', header = T, sep = ",") data4 <- read.csv('Trait data.csv', header = T, sep = ",") # _______________________ PLOTTING _____________________________________________### cool_dry <- subset (data4, climate.description == "Temperate_Dry", select = colnames(data4)) warm_wet <- subset (data4, climate.description == "Subtropical_Wet", select = colnames(data4)) hot_dry <- subset (data4, climate.description == "Tropical_Monsoonal", select = colnames(data4)) warm_arid <- subset (data4, climate.description == "Subtropical_Arid", select = colnames(data4)) warm_dry <- subset (data4, climate.description == "Subtropical_Dry", select = colnames(data4)) # ______________Fig 1, panel a (KLA_pet ~ tot Vden)__________________________________________## ## TURN ON IF SAVING TO FILE tiff(file="gs vs Vden.tiff", height=4.5, width=14, units="in", res=200) # pdf("gs vs Vden.pdf", height=4.5, width=14) # postscript("GS vs Vden, Veff.eps", horizontal = FALSE, onefile = FALSE, paper = "special", height = 4.5, width = 5) par(mfrow=c(1,3), oma=c(0.5, 0.5, 0.5, 0.5), mai=c(0.7, 1, 0.3, 0.3), mgp=c(3.5, 1.2, 0)) # par(mfrow=c(1,1), oma=c(0.5, 0.5, 0.5, 0.5), mai=c(1, 0.9, 0.5, 0.5), mgp=c(2.2,0.5,0)) plot(data4[,"Dv_tot"], data4[,"gs.adj."],axes=FALSE, pch=19, cex.lab=2, cex=2.3, cex.axis=2, log="xy", col="white", ylim=c(0.06, 1), # xlim=c(1.2, 26) ylab=expression(g[S]*" (mmol " * m^-2 *" "*s^-1*")"), xlab=expression(bold("total")*" vein density (mm " * mm^-2*")")) axis(1, tick=TRUE, line=0, tck=0.025, cex.axis=1.5) axis(2, tick=TRUE, line=0, las=2, tck=0.025, cex.axis=1.5) box(bty="l") points(cool_dry[,"Dv_tot"], cool_dry[,"gs.adj."], pch=0, cex=2, col="blue",lwd=2) points(warm_wet[,"Dv_tot"], warm_wet[,"gs.adj."], pch=1, cex=2, col="darkorchid3",lwd=2) points(hot_dry[,"Dv_tot"], hot_dry[,"gs.adj."], pch=2, cex=2, col="red",lwd=2) points(warm_arid[,"Dv_tot"], warm_arid[,"gs.adj."], pch=3, cex=2, col="darkorchid3",lwd=2) points(warm_dry[,"Dv_tot"], warm_dry[,"gs.adj."], pch=5, cex=2, col="darkorchid3",lwd=2) # OLS1=line.cis(log10(data4[,"gs.adj."]), log10(data4[,"Dv_tot"]), method="OLS") # curve(10^((log10(x)*(OLS1[2,1])+(OLS1[1,1]))), lwd=1, add=T) #, xlim=c(6, 900)) fit <- sma(log10(data4[,"gs.adj."])~log10(data4[,"Dv_tot"]), method="OLS"); fit text <- expression("a) " * r^2 * " = 0.08, p = 0.102") legend("topleft", text, bty="n", cex=1.5) # ______________Fig 1, panel b (KLA_pet ~ major Vden)__________________________________________## plot(data4[,"Dv_maj"], data4[,"gs.adj."],axes=FALSE, pch=19, cex.lab=2, cex=2.3, cex.axis=2, log="xy", col="white", ylim=c(0.06, 1), # xlim=c(1.2, 26) ylab=expression(g[S]*" (mmol " * m^-2 *" "*s^-1*")"), xlab=expression(bold("major")*" vein density (mm " * mm^-2*")")) axis(1, tick=TRUE, line=0, tck=0.025, cex.axis=1.5) axis(2, tick=TRUE, line=0, las=2, tck=0.025, cex.axis=1.5) box(bty="l") points(cool_dry[,"Dv_maj"], cool_dry[,"gs.adj."], pch=0, cex=2, col="blue",lwd=2) points(warm_wet[,"Dv_maj"], warm_wet[,"gs.adj."], pch=1, cex=2, col="darkorchid3",lwd=2) points(hot_dry[,"Dv_maj"], hot_dry[,"gs.adj."], pch=2, cex=2, col="red",lwd=2) points(warm_arid[,"Dv_maj"], warm_arid[,"gs.adj."], pch=3, cex=2, col="darkorchid3",lwd=2) points(warm_dry[,"Dv_maj"], warm_dry[,"gs.adj."], pch=5, cex=2, col="darkorchid3",lwd=2) # OLS1=line.cis(log10(data4[,"gs.adj."]), log10(data4[,"Dv_maj"]), method="OLS") # curve(10^((log10(x)*(OLS1[2,1])+(OLS1[1,1]))), lwd=1, add=T) #, xlim=c(6, 900)) fit <- sma(log10(data4[,"gs.adj."])~log10(data4[,"Dv_maj"]), method="OLS"); fit text <- expression("a) " * r^2 * " = 0.00, p = 0.821") legend("topleft", text, bty="n", cex=1.5) # ______________Fig 1, panel c (KLA_pet ~ minor Vden)__________________________________________## plot(data4[,"Dv_minor..mm.mm.2."], data4[,"gs.adj."],axes=FALSE, pch=19, cex.lab=2, cex=2.3, cex.axis=2, log="xy", col="white", ylim=c(0.06, 1), # xlim=c(1.2, 26) ylab=expression(g[S]*" (mmol " * m^-2 *" "*s^-1*")"), xlab=expression(bold("minor")*" vein density (mm " * mm^-2*")")) axis(1, tick=TRUE, line=0, tck=0.025, cex.axis=1.5) axis(2, tick=TRUE, line=0, las=2, tck=0.025, cex.axis=1.5) box(bty="l") points(cool_dry[,"Dv_minor..mm.mm.2."], cool_dry[,"gs.adj."], pch=0, cex=2, col="blue",lwd=2) points(warm_wet[,"Dv_minor..mm.mm.2."], warm_wet[,"gs.adj."], pch=1, cex=2, col="darkorchid3",lwd=2) points(hot_dry[,"Dv_minor..mm.mm.2."], hot_dry[,"gs.adj."], pch=2, cex=2, col="red",lwd=2) points(warm_arid[,"Dv_minor..mm.mm.2."], warm_arid[,"gs.adj."], pch=3, cex=2, col="darkorchid3",lwd=2) points(warm_dry[,"Dv_minor..mm.mm.2."], warm_dry[,"gs.adj."], pch=5, cex=2, col="darkorchid3",lwd=2) # OLS1=line.cis(log10(data4[,"gs.adj."]), log10(data4[,"Dv_minor..mm.mm.2."]), method="OLS") # curve(10^((log10(x)*(OLS1[2,1])+(OLS1[1,1]))), lwd=1, add=T) #, xlim=c(6, 900)) fit <- sma(log10(data4[,"gs.adj."])~log10(data4[,"Dv_minor..mm.mm.2."]), method="OLS"); fit text <- expression("a) " * r^2 * " = 0.03, p = 0.338") legend("topleft", text, bty="n", cex=1.5) dev.off()