Commit 97fdfa7b authored by Kunstler Georges's avatar Kunstler Georges
Browse files

progress on removing footnotes

parent e4102ad6
......@@ -1048,6 +1048,32 @@ extract.param <- function(trait, list.res,
return(param.mean)
}
extract.param.b <- function(trait, list.res,
model = 'lmer.LOGLIN.ER.AD.Tf.r.biomes.species',
param.vec = c("logD", "Tf","sumBn", "sumTnBn",
"sumTfBn", "sumTnTfBn.abs"),
data.type = 'simple',
biomes = biomes.factor.selected() ){
require(reshape2)
list.temp <- list.res[[paste0(data.type, "_", trait ,
"_", model)]]
res <- lapply(param.vec, fun.get.fixed.biomes, list.temp, biomes)
param <- do.call('rbind', lapply(res, function(x) x[[1]]))
rownames(param) <- param.vec
vec.Neg <- !row.names(param) %in% c("(Intercept)", "logD",
"Tf", 'MAT', 'MAP', "sumTfBn")
param[vec.Neg,] <- - param[vec.Neg,]
df.param <- data.frame(param=rownames(param), param)
df.melt <- melt(df.param, id.vars = 'param')
param.sd <- do.call('rbind', lapply(res, function(x) x[[2]]))
df.param.sd <- data.frame(param=rownames(param), param.sd)
names(df.param.sd) <- names(df.param)
df.melt.sd <- melt(df.param.sd, id.vars = 'param')
return(list(df.melt, df.melt.sd))
}
extract.param.sd <- function(trait, list.res,
model = 'lmer.LOGLIN.ER.AD.Tf.r.biomes.species',
param.vec = c("logD", "Tf","sumBn", "sumTnBn",
......@@ -1412,6 +1438,10 @@ names(traits_letters) <- c('Wood.density', 'SLA', 'Max.height')
cex.axis = 1.5, cex.lab = 1.7,
ylim = range(1-0.21, length(param.vec)+0.21),
col = c('black', col.vec[biomes.c]), ...)
y.max <- par("usr")[4] - (par("usr")[4] - par("usr")[3])*0.015
x.min <- par("usr")[1] + (par("usr")[2] - par("usr")[1])*0.045
text(x.min, y.max , traits_letters[i], font = 2, cex = 3)
mtext('', side=3, cex =1.7, line = 1)
box(lwd= 2)
lines(c(0, 0), c(par()$usr[3], par()$usr[4]), lwd= 1)
......@@ -1821,9 +1851,12 @@ if(p == 'alphae'){
add.alpha <- function(col, alpha=0.5){
if(missing(col))
stop("Please provide a vector of colours.")
apply(sapply(col, col2rgb)/255, 2,
function(x)
rgb(x[1], x[2], x[3], alpha=alpha))
fake.alpha <- function(chan, alpha) chan +(255 -chan)*alpha
vec.col <- apply(col2rgb(col), MARGIN=1,
FUN = fake.alpha, alpha=alpha)/255
rgb(vec.col[1], vec.col[2], vec.col[3])
}
fun.plot.param.tf <- function(df, p, t, xlab, labels.x, labels.y,
......@@ -1849,6 +1882,10 @@ if(!add){
c(df.t[, 'upr'],
rev(df.t[, 'lwr'])),
col = add.alpha(col.vec[names.param[p]], 0.5), border = NA)
lines(df.t[ , 'Tf'],
df.t[, 'pred'],
col = col.vec[names.param[p]],
lwd = 3)
}else{
lines(df.t[ , 'Tf'],
df.t[, 'pred'],lwd = 3,col = col.vec[names.param[p]])
......
......@@ -26,9 +26,9 @@ world.map(NA, NA)
for(set in sets){
i <- data$set ==set
cex = 0.3
cex = 0.15
if(type.d[set] == 'lpp')
cex=1.1
cex=0.85
world.map(data[i, "Lon"], data[i, "Lat"], col = cols[[set]],
add=TRUE, cex=cex)
}
......
......@@ -135,11 +135,14 @@ return(list(lty.vec = lty.vec))
## biomes
fun.col.pch.biomes <- function(){
col.vec.biomes <- make.transparent(c("navajowhite3", "darkgoldenrod1",
col.vec.biomes <- col2rgb(c("navajowhite3", "darkgoldenrod1",
"sienna","darkolivegreen4",
"darkseagreen3", "forestgreen",
"darkgreen","olivedrab","gray"),
0.9)
"darkgreen","olivedrab","gray"))
fake.alpha <- function(chan, alpha) chan +(255 -chan)*alpha
col.a <- fake.alpha(col.vec.biomes, alpha = 0.1)/255
col.vec.biomes <- rgb(col.a[1, ], col.a[2, ], col.a[3, ])
names(col.vec.biomes) <-
c('Subtropical desert', 'Temperate grassland desert',
'Woodland shrubland', 'Temperate forest',
......
all: paper_all.pdf SupplMat.pdf extended_data.pdf paper.docx extended_method.docx SupplMat.docx
paper_all.pdf: paper.pdf extended_data.pdf
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ paper.pdf extended_data.pdf
tables: ED_Table1.eps ED_Table2.eps ED_Table3.eps ED_Table4.eps
paper.pdf: paper.tex ms.sty references.bib
xelatex $<
xelatex paper.tex
xelatex paper.tex
paper_all.pdf: paper_ED._NFpdf tables FigDef/*.pdf
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ paper_ED_NF.pdf FigDef/Fig1.pdf FigDef/Fig2.pdf FigDef/Fig3.pdf FigDef/ED_Fig1.pdf ED_Table1.pdf ED_Table2.pdf ED_Table3.pdf FigDef/ED_Fig2.pdf FigDef/ED_Fig3.pdf FigDef/ED_Fig4 .pdf ED_Table4.pdf
paper_ED.pdf: paper_ED.tex ms.sty references.bib
xelatex $<
xelatex paper_ED.tex
ED_Table4.pdf: ED_Table4.tex
paper_ED_NF.pdf: paper_ED_NF.tex ms.sty references.bib
xelatex $<
xelatex paper_ED_NF.tex
paper.docx: paper.tex include.tex references.bib
pandoc -s -S $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -s -o paper.docx
extended_method.pdf: extended_method.tex ms.sty references.bib
ED_Table1.pdf: ED_Table1.tex
xelatex $<
bibtex extended_method
xelatex extended_method.tex
xelatex extended_method.tex
rm extended_method.log extended_method.out extended_method.aux extended_method.bbl extended_method.blg
extended_method.docx: extended_method.tex include.tex references.bib
pandoc -s -S $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -o $@
ED_Table1.eps: ED_Table1.pdf
pdftops -eps $< $@
ED_Table2.pdf: ED_Table2.tex
xelatex $<
ED_Table2.eps: ED_Table2.pdf
pdftops -eps $< $@
extended_data.pdf: extended_data.tex include.tex
ED_Table3.pdf: ED_Table3.tex
xelatex $<
xelatex extended_data.tex
xelatex extended_data.tex
extended_data.docx: extended.tex include.tex references.bib
pandoc -s -S $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -s -o $@
ED_Table3.eps: ED_Table3.pdf
pdftops -eps $< $@
ED_Table4.pdf: ED_Table4.tex
xelatex $<
ED_Table4.eps: ED_Table4.pdf
pdftops -eps $< $@
SupplMat.pdf: Suppl_Mat.Rmd include.tex references.bib
Rscript -e "library(knitr); knit('Suppl_Mat.Rmd', output = 'SupplMat.md')"
pandoc SupplMat.md --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt --latex-engine=xelatex -o $@
SupplMat.docx: SupplMat.md SupplMat.pdf include.tex references.bib
pandoc $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -o $@
clean:
rm -f *.pdf
rm -f *.html
......
% Supplementary Information
## Details on data sets used
# Details on growth data used in analysis
Two main data types were used: national forest inventories -- NFI, large permanent plots -- LPP.
......
% Supplementary Information
# Details on data sets used
# Details on growth data used in analysis
Two main data types were used: national forest inventories -- NFI, large permanent plots -- LPP.
......
This diff is collapsed.
......@@ -22,9 +22,6 @@
\linenumbers
%% \RequirePackage{refstyle}
%% \renewcommand{\figref}{\Figref}
%% \renewcommand{\tabref}{\Tabref}
% Allow \-/ hyphenation of already-hyphen\-/ated words
\usepackage[shortcuts]{extdash}
......@@ -63,10 +60,6 @@
% \iffinal
\newcommand{\email}[1]{\texttt{#1}}
\newcommand{\url}[1]{\texttt{#1}}
% \else
% \usepackage[colorlinks,citecolor=navy,linkcolor=navy,urlcolor=navy]{hyperref}
% \newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
% \fi
% Float figures to the end.
\iffinal
......@@ -85,14 +78,6 @@
\fi
\iffinal
%% Titles for Systematic biology:
%% \usepackage{titlesec}
%% \titleformat*{\section}{\large\scshape}
%% \titleformat*{\subsection}{\itshape}
%% \titleformat{\subsubsection}[runin]
%% {\normalfont\itshape}
%% {}{0pt}{}[. ---]
%\titleformat{\subsubsection}[runin]{\itshape}
\fi
\setcounter{secnumdepth}{0}
......@@ -111,7 +96,6 @@
\RequirePackage[hmargin=2cm,vmargin=3.5cm]{geometry}
\usepackage{setspace}
%\newcommand{\textspacing}{\setstretch{1.45}}
%% % Pre-emptive strike against manuscript central
%% \pdfminorversion=3
......
......@@ -95,3 +95,18 @@ text(67,-80, '> 3 million trees & > 2500 species', col = 'red', cex = 1.2)
dev.off()
tiff(file.path('figs','world_map.tiff'), width = 18.3, height = 9.15, units = 'cm', res = 300)
world.map.all.sites(clim,
add.legend=FALSE,
cols = fun.col.pch.set()$col.vec)
legend(-187, -0, xjust = 0, yjust = 0, legend =names.set[set.order.i] , col = cols.vec[set.order.i],
pt.bg = cols.vec[set.order.i] ,
box.col = "white",bg = "white",
pt.cex = 0.2, pch = 21, cex = 0.6, title = 'NFI')
legend(-187, -60, xjust = 0, yjust = 0, legend =names.set[set.order.b] , col = cols.vec[set.order.b],
pch = 21,
pt.bg = cols.vec[set.order.b], pt.cex = 0.85,
box.col = "white",bg = "white", cex = 0.6, title = 'LPP', title.adj = 0.3)
text(67,-80, '> 3 million trees & > 2500 species', col = 'red', cex = 1)
dev.off()
......@@ -62,6 +62,27 @@ plot.param.mean.and.biomes.fixed(list.all.results.set , data.type = "simple",
xlim = c(-0.30, 0.35))
dev.off()
setEPS()
postscript('figs/figres12_TP.eps', width = 16, height = 18)
plot.param.mean.and.biomes.fixed(list.all.results.set , data.type = "simple",
models = c('lmer.LOGLIN.ER.AD.Tf.MAT.MAP.r.set.species',
'lmer.LOGLIN.ER.AD.Tf.MAT.MAP.r.set.fixed.biomes.species'),
traits = c('Wood.density' , 'SLA', 'Max.height'),
param.vec = c("sumBn","sumTnTfBn.abs", "sumTfBn","sumTnBn",
"Tf"),
param.print = 1:5,
param.names = c(expression(' '(alpha[0])),
expression('Dissim '(alpha['d'])),
expression('Tolerance '(alpha['t'])),
expression('Effect '(alpha['e'])),
expression("Trait link"(m[1])),
expression("Size "(gamma %*% log('D'))) ) ,
col.vec = fun.col.pch.biomes()$col.vec,
pch.vec = fun.col.pch.biomes()$pch.vec,
names.bio = names.biomes ,
xlim = c(-0.30, 0.35))
dev.off()
pdf('figs/figres12_TP_intra.pdf', height = 14, width = 16)
plot.param.mean.and.biomes.fixed(list.all.results.intra , data.type = "intra",
......@@ -136,6 +157,15 @@ fun.plot.all.param(list.all.results.intra,
dev.off()
setEPS()
postscript('figs/figres4b_TP_intra.eps', width = 8, height = 11)
fun.plot.all.param(list.all.results.intra,
model = 'lmer.LOGLIN.ER.AD.Tf.MAT.MAP.intra.r.set.species',
MAT.MAP.TF = TRUE, intra.TF = TRUE,
data.type ='intra')
dev.off()
pdf('figs/rho_set_TP_intra.pdf', width = 9, height = 3)
fun.plot.all.rho(list.all.results.intra,
......@@ -145,3 +175,10 @@ dev.off()
setEPS()
postscript('figs/rho_set_TP_intra.eps', width = 9, height = 3)
fun.plot.all.rho(list.all.results.intra,
model = 'lmer.LOGLIN.ER.AD.Tf.MAT.MAP.intra.r.set.species',
MAT.MAP.TF = TRUE, intra.TF = TRUE, data.type ='intra')
dev.off()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment