Commit eba0a4c6 authored by kunstler's avatar kunstler
Browse files

work on figures

parent a1ea35f2
......@@ -511,8 +511,8 @@ ggplot(DF, aes_string(x = var.x, y = var.y, colour = var.quant)) +
fun.axis.one.by.one <- function(x, side, labels, cols.vec ){
axis(side, x, labels = bquote(.(labels[x])), las = 1, cex.axis = 2,
fun.axis.one.by.one <- function(x, side, labels, cols.vec , cex.axis = 2){
axis(side, x, labels = bquote(.(labels[x])), las = 1, cex.axis = cex.axis,
mgp = c(1.5,0.55,0),col.axis = cols.vec[x])
}
......@@ -565,10 +565,13 @@ for (i in traits){
par(mai=c(1.2,0,0.6,small.m))
}
plot(param.mean[param.print], (1:length(param.vec))[param.print],
yaxt = 'n', xlab = paste('Effect size '), ylab = NA,
pch = 16 , cex = 2, cex.lab = 1.5,
yaxt = 'n', xlab = NA, ylab = NA,
pch = 16 , cex = 2, cex.lab = 1.7,cex.axis = 1.5,
ylim = range(1:length(param.vec)), ...)
mtext(traits.names[i], side=3, cex =1.2, line = 1)
if(i == traits[2]) mtext('Standardized coefficients', side=1, cex =1.7,
line = 4)
mtext(traits.names[i], side=3, cex =1.7, line = 1)
box(lwd= 2)
abline(v = 0)
if(i == traits[1]) {lapply(1:length(param.vec),
......@@ -580,7 +583,7 @@ for (i in traits){
fun.plot.error.bar.horiz(param.mean[param.print],
(1:length(param.vec))[param.print],
param.std[param.print])
seq.jitter <- seq(-10,10, length.out = nrow(param.BLUP))/120
seq.jitter <- seq(-20,0, length.out = nrow(param.BLUP))/120
for (j in 1:length(param.vec)){
if(biomes.TF){
points(param.BLUP[,param.vec[j]], seq.jitter+rep(j,nrow(param.BLUP)),
......@@ -599,7 +602,7 @@ for (i in traits){
par(mar=c(0, 0, 0, 0))
plot(1,1,type="n", axes=F, xlab="", ylab="")
legend("center",legend = names.bio, col = col.vec, pch = pch.vec,
bty = 'n', cex = 1)
bty = 'n', cex = 2)
}
......@@ -650,10 +653,11 @@ for (i in traits){
}
plot(param.mean[param.print], (1:length(param.vec))[param.print],
yaxt = 'n', xlab = NA, ylab = NA,
pch = 16, cex = 2, cex.lab = 1.5,
pch = 16, cex = 2, cex.lab = 1.7, cex.axis = 1.5,
ylim = range(1:length(param.vec)), ...)
mtext(traits.names[i], side=3, cex =1.2, line = 1)
if(i == traits[2]) mtext('Standardized coefficients', side=1, cex =1.2, line = 3)
mtext(traits.names[i], side=3, cex =1.7, line = 1)
if(i == traits[2]) mtext('Standardized coefficients', side=1, cex =1.7,
line = 4)
box(lwd= 2)
abline(v = 0)
if(i == traits[1]) {lapply(1:length(param.vec),
......@@ -762,24 +766,28 @@ for (i in traits){
if(i == traits[length(traits)]) {
par(mai=c(1.2,0,0.6,small.m))
}
seq.jitter <- seq(-10,10, length.out = length(biomes))/120
seq.jitter <- seq(-15,15, length.out = length(biomes))/120
if(n.vars == 1){
plot(param.mean, seq.jitter+n.vars,
yaxt = 'n', xlab = 'Effect size ', ylab = NA,
, pch = pch.vec[biomes.c] , cex = 2, cex.lab = 1.5,
ylim = range(seq_len(length(param.vec))),
col = col.vec[biomes.c], ...)}
yaxt = 'n', xlab = NA, ylab = NA,
, pch = pch.vec[biomes.c] , cex = 2, cex.axis = 1.5, cex.lab = 1.5,
ylim = range(1-0.15, length(param.vec)+0.15),
col = col.vec[biomes.c], ...)
if(i == traits[2]) mtext('Standardized coefficients', side=1, cex =1.4,
line = 4)
}
if(n.vars != 1){
points(param.mean, seq.jitter+n.vars,
col = col.vec[biomes.c], pch = pch.vec[biomes.c], cex = 2)}
mtext(traits.names[i], side=3, cex =1.2, line = 1)
mtext(traits.names[i], side=3, cex =1.4, line = 1)
box(lwd= 2)
abline(v = 0)
if(i == traits[1]) {lapply(1:length(param.vec),
fun.axis.one.by.one,
side = 2,
labels = param.names,
cols.vec = col.names[param.vec])
cols.vec = col.names[param.vec],
cex.axis = 1.6)
}
fun.plot.error.bar.horiz(param.mean,
seq.jitter+n.vars,
......
......@@ -99,7 +99,7 @@ plot.param(list.all.results.set , data.type = "simple",
col.vec = fun.col.pch.biomes()$col.vec,
pch.vec = fun.col.pch.biomes()$pch.vec,
names.bio = names.biomes ,
xlim = c(-0.5, 0.9))
xlim = c(-0.45, 0.51))
dev.off()
pdf('figs/figres1b.pdf', height = 7, width = 14)
......@@ -229,7 +229,7 @@ plot.param.biomes.fixed(list.all.results.set, data.type = 'simple',
(alpha[i] %*% t[c]))),
expression(paste("Direct trait effect ",
(m[1] %*% t[f])))) ,
param.print = 1:4,
param.print = 1:4,
col.vec = fun.col.pch.biomes()$col.vec,
pch.vec = fun.col.pch.biomes()$pch.vec,
xlim = c(-0.4, 0.3))
......
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