aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Kellner <ken.kellner@gmail.com>2016-09-28 21:49:52 (GMT)
committerKen Kellner <ken.kellner@gmail.com>2016-09-28 21:49:52 (GMT)
commita94146321d0322e9ed718f4b779ffeb7ec3571af (patch)
tree35b2d316e606dd0e0107168e0c8f0e1f53b68d69
parentd7beb4c3771aec2c39160c8c705360ec3202de24 (diff)
Modularize figures for future talks.
-rw-r--r--figures/fig6_hl_abun.R86
-rw-r--r--figures/figure_birddens.R15
-rw-r--r--figures/figure_multidens.R104
-rw-r--r--figures/figure_richness.R59
-rw-r--r--function_gen_treat_arrays.R3
-rw-r--r--presentations/figure_baci.R32
-rw-r--r--presentations/figure_es_density_mu.R180
-rw-r--r--presentations/figure_mf_density_mu.R170
-rw-r--r--presentations/figure_mistnet_counts.R26
-rw-r--r--presentations/figure_mu_bhco_abun.R59
-rw-r--r--presentations/figure_rubus.R39
-rw-r--r--presentations/figures_fscc2016.R231
-rw-r--r--presentations/figures_richness.R139
-rw-r--r--supplements/supplementS3.Rmd10
14 files changed, 415 insertions, 738 deletions
diff --git a/figures/fig6_hl_abun.R b/figures/fig6_hl_abun.R
index 2e3abdd..030e458 100644
--- a/figures/fig6_hl_abun.R
+++ b/figures/fig6_hl_abun.R
@@ -4,95 +4,21 @@
#Read in output
load('output/hl_bird_abun.Rdata')
+source('figure_multidens.R')
sp.include <- c('OVEN','REVI','ACFL',
'WOTH','WEWA','CERW',
'BAWW','HOWA','CARW',
'EATO','INBU','WEVI')
-nsp <- length(sp.include)
-
-#Location in 3x3 grid
-nrow <- 3
-ncol <- 4
-col.loc <- c(1,2,3,1,2,3,1,2,3,1,2,3)
-row.loc <- c(4,4,4,3,3,3,2,2,2,1,1,1)
-
-#Control figure width based on # of columns
-maxx <- 10
-adjx <- c(0,11,22)
-wi <- nrow*10+3
-xticks1 <- c(2,4,6,8,10)
-xticks2 <- xticks1+adjx[2]
-xticks3 <- xticks1+adjx[3]
-
-#Control figure height to fit all species figures
-maxy <- 6
-titleht<- maxy/4
-adjy <- c(0,(maxy+titleht),(maxy+titleht)*2,(maxy+titleht)*3)
-ht <- (maxy+titleht)*ncol
-yticks1 <- c(1,2,3,4,5)
-yticks2 <- yticks1+adjy[2]
-yticks3 <- yticks1+adjy[3]
-yticks4 <- yticks1+adjy[4]
-
-titlesz <- 0.8
-lwd <- 1
-
-ltys <- c(1:5)
-cols <- gray(c(0,0.7,0.5,0.4,0.2))
#Set up figure container
tiff(filename="figures/fig6_abun.tiff",width=90,height=118,units="mm",res=1000, pointsize=8,
compression = "lzw",type='cairo')
-par(mar = c(3,3,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(0.6,0.6,0))
-plot(1,type='n',xlim=c(0,wi),ylim=c(0,ht),xaxt='n',yaxt='n',xaxs='i',yaxs='i',
- ylab="",xlab='')
-
-#Set up axes
-axis(1,at=c(xticks1,xticks2,xticks3),labels=rep(c(2,4,6,8,10),3),tcl=-0.3,cex.axis=0.8)
-axis(2,at=c(yticks1,yticks2,yticks3,yticks4),labels=rep(c(1,2,3,4,5),4),tcl=-0.3,cex.axis=0.8)
-
-title(xlab='Year',line=1.7)
-title(ylab=expression(paste("Density Index (males ha"^{-1},")")),line=1.7)
-
-#Draw lines dividing up plot into 3x3 grid
-abline(v=11)
-abline(v=22)
-abline(h=maxy)
-abline(h=maxy+titleht)
-abline(h=adjy[2]+maxy)
-abline(h=adjy[2]+maxy+titleht)
-abline(h=adjy[3]+maxy)
-abline(h=adjy[3]+maxy+titleht)
-abline(h=adjy[4]+maxy)
-abline(h=adjy[4]+maxy+titleht)
-
-#Iterate through species
-for (i in 1:nsp){
- ind <- which(species==sp.include[i])
-
- xloc <- c(1:10) + adjx[col.loc[i]] #Location on x-axis
-
- #Iterate through treatments and draw lines
- for (j in 1:5){
- abun.vector <- colMeans(Ntreat.harvest[,,j,ind])+adjy[row.loc[i]] #Calculate treatment x year means
- lines(xloc,abun.vector,lwd=lwd,lty=ltys[j],col=cols[j])
- lines(xloc[c(7,9)],abun.vector[c(7,9)],col=cols[j],lty=ltys[j])
- }
-
- #Draw vertical line at time of harvest
- segments(x0=mean(xloc[3:4]),y0=adjy[row.loc[i]],
- x1=mean(xloc[3:4]),y1=adjy[row.loc[i]]+maxy,lty=2)
-
- #Add species alpha code
- text(adjx[col.loc[i]]+(maxx+1)/2,adjy[row.loc[i]]+maxy+titleht/2,sp.include[i])
-
-}
-
-#Add legend
-legend(0,13.5,c('No Harvest','Clearcut','Patch','Shelter','Single-tree'),cex=0.8,
- lwd=1,col=cols,bg="white",lty=ltys,ncol=3)
-
+multi.birddens(sp.include,scale='hl',nrow=4,ncol=3,maxy=6,
+ yticks=c(1,2,3,4,5),
+ legendcol=3,legendpos=c(2,1),
+ cols=gray(c(0,0.7,0.5,0.4,0.2)),
+ ltys=c(1:5),lwd=1)
dev.off() \ No newline at end of file
diff --git a/figures/figure_birddens.R b/figures/figure_birddens.R
index e589cda..6c2ca6c 100644
--- a/figures/figure_birddens.R
+++ b/figures/figure_birddens.R
@@ -3,7 +3,7 @@ bird.figure <- function(sp,scale,
cred=FALSE,se=FALSE,
legendpos='topleft',defaultpar=TRUE,legcex=1,
ylab=expression(paste("Density (males ha"^{-1},")")),
- title=NULL,color=FALSE,extralabels=FALSE){
+ title=NULL,color=NULL,extralabels=FALSE,legend.lwd=2){
#Set up options based on arguments
ind <- which(sp==species)
@@ -21,8 +21,9 @@ bird.figure <- function(sp,scale,
#Options based on analysis scale
if(scale=='mu'){
- if(color){
- colors = c('black','red','blue')
+ if(!is.null(color)){
+ #colors = c('black','red','blue')
+ colors <- color
}else{colors = (gray(seq(0.4,0.1,length=3)))}
lty <- c(1:3)
pch <- c(17:19)
@@ -31,15 +32,15 @@ bird.figure <- function(sp,scale,
legendtx <- c('NH','EA','UA')
}
if(scale=='hl'){
- if(color){
- colors = c('black','firebrick1','orange','dodgerblue','forestgreen')
+ if(!is.null(color)){
+ #colors = c('black','firebrick1','orange','dodgerblue','forestgreen')
+ colors <- color
lty <- rep(1,5)
}else{
colors <- gray(c(0,0.7,0.5,0.4,0.2))
lty <- c(1:5)
}
-
pch <- c(17,15,16,18,21)
ntreat <- 5
N <- Ntreat.harvest
@@ -113,7 +114,7 @@ bird.figure <- function(sp,scale,
legendtx <- legendtx[ordered]
legend(legendpos,legendtx,cex=legcex,
- pch=pch,lwd=2,col=colors,bg="white",lty=lty)
+ pch=pch,lwd=legend.lwd,col=colors,bg="white",lty=lty)
}
} \ No newline at end of file
diff --git a/figures/figure_multidens.R b/figures/figure_multidens.R
new file mode 100644
index 0000000..375022b
--- /dev/null
+++ b/figures/figure_multidens.R
@@ -0,0 +1,104 @@
+
+multidens.figure <- function(sp.include,sp.name=NULL,scale,
+ nrow,ncol,maxy,yticks,
+ legendcol=1,legendpos=c(1,nrow),
+ cols,ltys,lwd=1){
+
+ nsp <- length(sp.include)
+ col.loc <- rep(1:ncol,nrow)
+ row.loc <- rep(nrow:1,each=ncol)
+
+ #Set up X-axis
+ maxx <- 10
+
+ adjx <- seq(0,10*(ncol-1)+ncol,11)
+ wi <- (ncol)*10+ncol
+
+ xticks.all <- xticks <- c(2,4,6,8,10)
+ for (i in 2:ncol){
+ xticks.all <- c(xticks.all,xticks+adjx[i])
+ }
+
+ #Control figure height to fit all species figures
+ titleht<- maxy/4
+ adjy <- seq(0,(maxy+titleht)*(nrow),(maxy+titleht))
+ ht <- (maxy+titleht)*nrow
+
+ yticks.all <- yticks
+ for (i in 2:nrow){
+ yticks.all <- c(yticks.all,yticks+adjy[i])
+ }
+
+ titlesz <- 0.8
+
+ #Set up plot
+ par(mar = c(3,3,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(0.6,0.6,0))
+
+ plot(1,type='n',xlim=c(0,wi),ylim=c(0,ht),xaxt='n',yaxt='n',xaxs='i',yaxs='i',
+ ylab="",xlab='')
+
+ #Set up axes
+ axis(1,at=xticks.all,labels=rep(xticks,ncol),tcl=-0.3,cex.axis=0.8)
+ axis(2,at=yticks.all,labels=rep(yticks,nrow),tcl=-0.3,cex.axis=0.8)
+
+ title(xlab='Year',line=1.7)
+ title(ylab=expression(paste("Density Index (males ha"^{-1},")")),line=1.7)
+
+ #Draw lines dividing up plot into 3x3 grid
+
+ for (i in 2:ncol){
+ abline(v=adjx[i])
+ }
+
+ for (i in 1:nrow){
+ abline(h=adjy[i]+maxy)
+ abline(h=adjy[i]+maxy+titleht)
+ }
+
+ #Set up scale-level variables
+ if(scale=='mu'){
+ ntreat <- 3
+ legend.labs <- c('No Harvest','Even-Aged','Uneven-Aged')
+ Ntreat <- Ntreat
+ }
+ if(scale=='hl'){
+ ntreat <- 5
+ legend.labs <- c('No Harvest','Clearcut','Patch','Shelter','Single-tree')
+ Ntreat <- Ntreat.harvest
+ }
+
+ if(is.null(sp.name)){sp.name <- sp.include}
+
+ #Iterate through species
+ for (i in 1:nsp){
+
+ ind <- which(species==sp.include[i])
+
+ xloc <- c(1:10) + adjx[col.loc[i]] #Location on x-axis
+
+ #Draw lines for each treatment
+ for (j in 1:ntreat){
+ abun.vector <- colMeans(Ntreat[,,j,ind])+adjy[row.loc[i]]
+ lines(xloc,abun.vector,lwd=lwd,lty=ltys[j],col=cols[j])
+ lines(xloc[c(7,9)],abun.vector[c(7,9)],col=cols[j],lty=ltys[j],lwd=lwd)
+ }
+
+ #Draw vertical line at time of harvest
+ segments(x0=mean(xloc[3:4]),y0=adjy[row.loc[i]],
+ x1=mean(xloc[3:4]),y1=adjy[row.loc[i]]+maxy,lty=2)
+
+ #Add species code
+ text(adjx[col.loc[i]]+(maxx+1)/2,adjy[row.loc[i]]+maxy+titleht/2,sp.name[i])
+
+ }
+
+ #Draw legend
+ legendx <- ht-titleht-(nrow-legendpos[1])*(maxy+titleht)
+ legendy <- adjx[legendpos[2]]
+
+ legend(x=legendy,y=legendx,legend.labs,cex=0.8,
+ lwd=lwd,col=cols,bg="white",lty=ltys,ncol=legendcol)
+
+
+
+} \ No newline at end of file
diff --git a/figures/figure_richness.R b/figures/figure_richness.R
new file mode 100644
index 0000000..d8d5171
--- /dev/null
+++ b/figures/figure_richness.R
@@ -0,0 +1,59 @@
+
+richness.figure <- function(scale,figmin,figmax,cols,pchs,ltys){
+
+ if(scale=='mu'){
+ ntreat <- 3
+ Rtreat <- Rtreat
+ legendtext <- c('No Harvest','Even-Aged','Uneven-Aged')
+ }
+ if(scale=='hl'){
+ ntreat <- 5
+ Rtreat <- Rtreat.harvest
+ legendtext <- c('No Harvest','Clearcut','Patch Cut','Shelter','Single-tree')
+ }
+
+ #Functions to calculate 95% CI
+ qu <- function(x){as.numeric(quantile(x,0.975,na.rm=T))}
+ ql <- function(x){as.numeric(quantile(x,0.025,na.rm=T))}
+
+ rich.means <- rich.upper <- rich.lower <- matrix(NA,nrow=ntreat,ncol=10)
+ for (i in 1:ntreat){
+ rich.means[i,] <- colMeans(Rtreat[,,i])
+ rich.lower[i,] <- apply(Rtreat[,,i],2,ql)
+ rich.upper[i,] <- apply(Rtreat[,,i],2,qu)
+ }
+
+ #Set up plot
+ par(mar = c(4,3.5,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(2.5,1,0))
+
+ plot(1:10,rich.means[1,],ylim=c(figmin,figmax),
+ main="",type='o',cex=2,lty=ltys[1],col=cols[1],
+ lwd=2,pch=pchs[1],xaxt='n',xlab="Year",ylab='Richness',
+ xlim=c(0.5,10.5))
+ axis(side=1,at=c(1,3,5,7,9), labels=c('2006', '2008', '2010','2012','2014'),tck=0)
+
+ #Error bars
+ wd=0.1
+ for (i in 1:10){
+ for (j in 1:ntreat){
+ segments(i,rich.lower[j,i],i,rich.upper[j,i])
+ segments(i-wd,rich.lower[j,i],i+wd,rich.lower[j,i])
+ segments(i-wd,rich.upper[j,i],i+wd,rich.upper[j,i])
+ }
+ }
+
+ #Draw lines
+ for (j in 1:ntreat){
+ lines(1:10,rich.means[j,],type='o',cex=2,lty=ltys[j],col=cols[j],
+ lwd=2,pch=pchs[j])
+ lines(c(7,9),rich.means[j,c(7,9)],lty=ltys[j],col=cols[j],lwd=2)
+ }
+
+ #Draw vertical line at time of harvest
+ abline(v=3.5,lty=2)
+
+ #Add legend
+ legend('topleft',legendtext,cex=1,
+ pch=pchs,lwd=2,col=cols,bg="white",lty=ltys)
+
+} \ No newline at end of file
diff --git a/function_gen_treat_arrays.R b/function_gen_treat_arrays.R
index c81a7d9..56a31f4 100644
--- a/function_gen_treat_arrays.R
+++ b/function_gen_treat_arrays.R
@@ -9,7 +9,8 @@ gen.treat.array <- function(jags.object,cov.data,obs.data,species,scale){
survey.info.sub <- cov.data$survey.info[obs.data$trans[,1],]
area.adjust <- 1.766 #For 75 m radius
- patch.area.adjust <- 1.1035 #Mean of patch size radii post-harvest
+ #patch.area.adjust <- 1.1035 #Mean of patch size radii post-harvest
+ patch.area.adjust <- 1.766 #Mean of patch size radii post-harvest
if(scale=='mu'){
ntreat <- 3 #Even, Uneven, No Harvest
diff --git a/presentations/figure_baci.R b/presentations/figure_baci.R
deleted file mode 100644
index 60294c2..0000000
--- a/presentations/figure_baci.R
+++ /dev/null
@@ -1,32 +0,0 @@
-
-structure <- c(1:10)
-
-control <- rnorm(10,0.3,0.05)
-
-treatment <- c(rnorm(3,0.3,0.05),rnorm(7,1,0.1))
-
-cols <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255))
-
-png(filename="presentations/images/baci.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mgp=c(3,1,0),mar = c(4.5,4.5,1,1) + 0.1,oma=c(0,0,0,0))
-plot(structure,treatment,type='l',col=cols[2],lwd=2,ylim=c(0,1.5),
- xlab='Year',ylab='Abundance')
-lines(structure,control,col=cols[1],lwd=2)
-abline(v=3.5,lty=2)
-text(3,1,'Treatment Applied',srt=90)
-text(mean(c(0.5,3.5)),0.1,'Before',font=2)
-text(mean(c(3.5,10.5)),0.1,'After',font=2)
-
-arrows(7,0.7,7,control[7]+0.05,length=0.1,lwd=2)
-arrows(7,0.7,7,treatment[7]-0.05,length=0.1,lwd=2)
-
-arrows(2,0.33,2,control[2]+0.01,length=0.05,lwd=2)
-arrows(2,0.33,2,treatment[2]-0.01,length=0.05,lwd=2)
-
-legend('topright',col=cols[1:2],lwd=2,legend=c('Control','Treatment'))
-
-dev.off() \ No newline at end of file
diff --git a/presentations/figure_es_density_mu.R b/presentations/figure_es_density_mu.R
deleted file mode 100644
index 8d0bd14..0000000
--- a/presentations/figure_es_density_mu.R
+++ /dev/null
@@ -1,180 +0,0 @@
-#Generate Ntreat arrays, if necessary
-#source(/figures/script_gen_treat_arrays.R)
-
-#Species to include
-sp.include <- c('EATO','INBU',
- 'CARW','YBCH')
-sp.name <- c('Eastern Towhee','Indigo Bunting','Carolina Wren','Yellow-breasted Chat')
-nsp <- length(sp.include)
-
-#Location in 2x2 grid
-nrow <- 2
-ncol <- 2
-col.loc <- c(1,2,1,2)
-row.loc <- c(2,2,1,1)
-
-#Control figure width based on # of columns
-maxx <- 10
-adjx <- c(0,11,22)
-wi <- nrow*10+2
-xticks1 <- c(2,4,6,8,10)
-xticks2 <- c(2,4,6,8,10)+adjx[2]
-xticks3 <- c(2,4,6,8,10)+adjx[3]
-
-#Control figure height to fit all species figures
-maxy <- 1.2
-titleht<- maxy/4
-adjy <- c(0,(maxy+titleht),(maxy+titleht)*2,(maxy+titleht)*3)
-ht <- (maxy+titleht)*ncol
-yticks1 <- c(0.25,0.5,0.75,1)
-yticks2 <- yticks1+adjy[2]
-yticks3 <- yticks1+adjy[3]
-yticks4 <- yticks1+adjy[4]
-
-#Some figure options common to both figures
-titlesz <- 0.8
-lwd <- 2
-
-##############################################################
-## Abundance Figure for Management Spatial Scale - Figure 2 ##
-##############################################################
-
-#Specify some additional figure options
-#cols <- gray(c(0,0.4,0.6))
-cols <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255))
-ltys <- c(1,1,1)
-
-#Set up figure container
-png(filename="presentations/images/mu_abun_es.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mar = c(3,3,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(0.6,0.6,0))
-
-plot(1,type='n',xlim=c(0,wi),ylim=c(0,ht),xaxt='n',yaxt='n',xaxs='i',yaxs='i',
- ylab="",xlab='')
-
-#Set up axes
-axis(1,at=c(xticks1,xticks2,xticks3),labels=rep(c(2,4,6,8,10),3),tcl=-0.3,cex.axis=0.8)
-axis(2,at=c(yticks1,yticks2,yticks3,yticks4),labels=rep(c(0.25,0.5,0.75,1),4),tcl=-0.3,cex.axis=0.8)
-
-title(xlab='Year',line=1.7)
-title(ylab=expression(paste("Density (males ha"^{-1},")")),line=1.7)
-
-#Draw lines dividing up plot into 3x3 grid
-abline(v=11)
-#abline(v=22)
-abline(h=maxy)
-abline(h=maxy+titleht)
-abline(h=adjy[2]+maxy)
-abline(h=adjy[2]+maxy+titleht)
-
-
-#Iterate through species
-for (i in 1:nsp){
-
- ind <- which(species==sp.include[i])
-
- xloc <- c(1:10) + adjx[col.loc[i]] #Location on x-axis
-
- #Draw lines for each treatment
- for (j in 1:3){
- abun.vector <- colMeans(Ntreat[,,j,ind])/3.14+adjy[row.loc[i]] #Calculate yearly means for treatment j
- lines(xloc,abun.vector,lwd=lwd,lty=ltys[j],col=cols[j])
- lines(xloc[c(7,9)],abun.vector[c(7,9)],col=cols[j],lty=ltys[j],lwd=lwd)
- }
-
- #Draw vertical line at time of harvest
- segments(x0=mean(xloc[3:4]),y0=adjy[row.loc[i]],
- x1=mean(xloc[3:4]),y1=adjy[row.loc[i]]+maxy,lty=2)
-
- #Add species code
- text(adjx[col.loc[i]]+(maxx+1)/2,adjy[row.loc[i]]+maxy+titleht/2,sp.name[i])
-
-}
-
-#Draw legend
-legend(0,2.7,c('No Harvest','Even-Aged','Uneven-Aged'),cex=0.8,
- lwd=2,col=cols,bg="white",lty=ltys)
-
-
-dev.off()
-
-################################################
-## Abundance Figure for Harvest Spatial Scale ##
-################################################
-
-#Control figure height to fit all species figures
-maxy <- 3.5
-titleht<- maxy/4
-adjy <- c(0,(maxy+titleht),(maxy+titleht)*2,(maxy+titleht)*3)
-ht <- (maxy+titleht)*ncol
-yticks1 <- c(0.5,1,1.5,2,2.5)
-yticks2 <- yticks1+adjy[2]
-yticks3 <- yticks1+adjy[3]
-yticks4 <- yticks1+adjy[4]
-
-#Specify some additional figure options
-cols <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255),
- rgb(248, 172, 135,max=255),
- rgb(255, 212, 128,max=255)
-)
-ltys <- c(1,1,1,1,1)
-
-#Set up figure container
-png(filename="presentations/images/hl_abun_es.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mar = c(3,3,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(0.6,0.6,0))
-
-plot(1,type='n',xlim=c(0,wi),ylim=c(0,ht),xaxt='n',yaxt='n',xaxs='i',yaxs='i',
- ylab="",xlab='')
-
-#Set up axes
-axis(1,at=c(xticks1,xticks2,xticks3),labels=rep(c(2,4,6,8,10),3),tcl=-0.3,cex.axis=0.8)
-axis(2,at=c(yticks1,yticks2,yticks3,yticks4),labels=rep(c(0.5,1,1.5,2,2.5),4),tcl=-0.3,cex.axis=0.8)
-
-title(xlab='Year',line=1.7)
-title(ylab=expression(paste("Density (males ha"^{-1},")")),line=1.7)
-
-#Draw lines dividing up plot into 3x3 grid
-abline(v=11)
-#abline(v=22)
-abline(h=maxy)
-abline(h=maxy+titleht)
-abline(h=adjy[2]+maxy)
-abline(h=adjy[2]+maxy+titleht)
-
-
-#Iterate through species
-for (i in 1:nsp){
- ind <- which(species==sp.include[i])
-
- xloc <- c(1:10) + adjx[col.loc[i]] #Location on x-axis
-
- #Iterate through treatments and draw lines
- for (j in c(1,2,4,3,5)){
- abun.vector <- colMeans(Ntreat.harvest[,,j,ind])/3.14+adjy[row.loc[i]] #Calculate treatment x year means
- lines(xloc,abun.vector,lwd=lwd,lty=ltys[j],col=cols[j])
- lines(xloc[c(7,9)],abun.vector[c(7,9)],col=cols[j],lty=ltys[j],lwd=lwd)
- }
-
- #Draw vertical line at time of harvest
- segments(x0=mean(xloc[3:4]),y0=adjy[row.loc[i]],
- x1=mean(xloc[3:4]),y1=adjy[row.loc[i]]+maxy,lty=2)
-
- #Add species alpha code
- text(adjx[col.loc[i]]+(maxx+1)/2,adjy[row.loc[i]]+maxy+titleht/2,sp.name[i])
-
-}
-
-#Add legend
-legend(0,7.89,c('Clearcut','Shelter','Patch Cut','Single-tree','No Harvest'),cex=0.8,
- lwd=2,col=cols[c(2,4,3,5,1)],bg="white",lty=ltys,ncol=3)
-
-
-dev.off()
-
diff --git a/presentations/figure_mf_density_mu.R b/presentations/figure_mf_density_mu.R
deleted file mode 100644
index d244ed7..0000000
--- a/presentations/figure_mf_density_mu.R
+++ /dev/null
@@ -1,170 +0,0 @@
-#Generate Ntreat arrays, if necessary
-#source(/figures/script_gen_treat_arrays.R)
-
-#Species to include
-sp.include <- c('OVEN','WOTH',
- 'WEWA','CERW')
-sp.name <- c('Ovenbird','Wood Thrush','Worm-eating Warbler','Cerulean Warbler')
-nsp <- length(sp.include)
-
-#Location in 2x2 grid
-nrow <- 2
-ncol <- 2
-col.loc <- c(1,2,1,2)
-row.loc <- c(2,2,1,1)
-
-#Control figure width based on # of columns
-maxx <- 10
-adjx <- c(0,11,22)
-wi <- nrow*10+2
-xticks1 <- c(2,4,6,8,10)
-xticks2 <- c(2,4,6,8,10)+adjx[2]
-xticks3 <- c(2,4,6,8,10)+adjx[3]
-
-#Control figure height to fit all species figures
-maxy <- 2.3
-titleht<- maxy/4
-adjy <- c(0,(maxy+titleht),(maxy+titleht)*2,(maxy+titleht)*3)
-ht <- (maxy+titleht)*ncol
-yticks1 <- c(0.5,1,1.5,2)
-yticks2 <- c(0.5,1,1.5,2)+adjy[2]
-yticks3 <- c(0.5,1,1.5,2)+adjy[3]
-yticks4 <- c(0.5,1,1.5,2)+adjy[4]
-
-#Some figure options common to both figures
-titlesz <- 0.8
-lwd <- 2
-
-##############################################################
-## Abundance Figure for Management Spatial Scale - Figure 2 ##
-##############################################################
-
-#Specify some additional figure options
-#cols <- gray(c(0,0.4,0.6))
-cols <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255))
-ltys <- c(1,1,1)
-
-#Set up figure container
-png(filename="presentations/images/mu_abun_mf.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mar = c(3,3,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(0.6,0.6,0))
-
-plot(1,type='n',xlim=c(0,wi),ylim=c(0,ht),xaxt='n',yaxt='n',xaxs='i',yaxs='i',
- ylab="",xlab='')
-
-#Set up axes
-axis(1,at=c(xticks1,xticks2,xticks3),labels=rep(c(2,4,6,8,10),3),tcl=-0.3,cex.axis=0.8)
-axis(2,at=c(yticks1,yticks2,yticks3,yticks4),labels=rep(c(0.5,1,1.5,2),4),tcl=-0.3,cex.axis=0.8)
-
-title(xlab='Year',line=1.7)
-title(ylab=expression(paste("Density (males ha"^{-1},")")),line=1.7)
-
-#Draw lines dividing up plot into 3x3 grid
-abline(v=11)
-#abline(v=22)
-abline(h=maxy)
-abline(h=maxy+titleht)
-abline(h=adjy[2]+maxy)
-abline(h=adjy[2]+maxy+titleht)
-
-
-#Iterate through species
-for (i in 1:nsp){
-
- ind <- which(species==sp.include[i])
-
- xloc <- c(1:10) + adjx[col.loc[i]] #Location on x-axis
-
- #Draw lines for each treatment
- for (j in 1:3){
- abun.vector <- colMeans(Ntreat[,,j,ind])/3.14+adjy[row.loc[i]] #Calculate yearly means for treatment j
- lines(xloc,abun.vector,lwd=lwd,lty=ltys[j],col=cols[j])
- lines(xloc[c(7,9)],abun.vector[c(7,9)],col=cols[j],lty=ltys[j],lwd=lwd)
- }
-
- #Draw vertical line at time of harvest
- segments(x0=mean(xloc[3:4]),y0=adjy[row.loc[i]],
- x1=mean(xloc[3:4]),y1=adjy[row.loc[i]]+maxy,lty=2)
-
- #Add species code
- text(adjx[col.loc[i]]+(maxx+1)/2,adjy[row.loc[i]]+maxy+titleht/2,sp.name[i])
-
-}
-
-#Draw legend
-legend(0,5.17,c('No Harvest','Even-Aged','Uneven-Aged'),cex=0.8,
- lwd=2,col=cols,bg="white",lty=ltys)
-
-
-dev.off()
-
-################################################
-## Abundance Figure for Harvest Spatial Scale ##
-################################################
-
-#Specify some additional figure options
-cols <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255),
- rgb(248, 172, 135,max=255),
- rgb(255, 212, 128,max=255)
-)
-ltys <- c(1,1,1,1,1)
-
-#Set up figure container
-png(filename="presentations/images/hl_abun_mf.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mar = c(3,3,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(0.6,0.6,0))
-
-plot(1,type='n',xlim=c(0,wi),ylim=c(0,ht),xaxt='n',yaxt='n',xaxs='i',yaxs='i',
- ylab="",xlab='')
-
-#Set up axes
-axis(1,at=c(xticks1,xticks2,xticks3),labels=rep(c(2,4,6,8,10),3),tcl=-0.3,cex.axis=0.8)
-axis(2,at=c(yticks1,yticks2,yticks3,yticks4),labels=rep(c(0.5,1,1.5,2),4),tcl=-0.3,cex.axis=0.8)
-
-title(xlab='Year',line=1.7)
-title(ylab=expression(paste("Density (males ha"^{-1},")")),line=1.7)
-
-#Draw lines dividing up plot into 3x3 grid
-abline(v=11)
-#abline(v=22)
-abline(h=maxy)
-abline(h=maxy+titleht)
-abline(h=adjy[2]+maxy)
-abline(h=adjy[2]+maxy+titleht)
-
-
-#Iterate through species
-for (i in 1:nsp){
- ind <- which(species==sp.include[i])
-
- xloc <- c(1:10) + adjx[col.loc[i]] #Location on x-axis
-
- #Iterate through treatments and draw lines
- for (j in c(1,2,4,3,5)){
- abun.vector <- colMeans(Ntreat.harvest[,,j,ind])/3.14+adjy[row.loc[i]] #Calculate treatment x year means
- lines(xloc,abun.vector,lwd=lwd,lty=ltys[j],col=cols[j])
- lines(xloc[c(7,9)],abun.vector[c(7,9)],col=cols[j],lty=ltys[j],lwd=lwd)
- }
-
- #Draw vertical line at time of harvest
- segments(x0=mean(xloc[3:4]),y0=adjy[row.loc[i]],
- x1=mean(xloc[3:4]),y1=adjy[row.loc[i]]+maxy,lty=2)
-
- #Add species alpha code
- text(adjx[col.loc[i]]+(maxx+1)/2,adjy[row.loc[i]]+maxy+titleht/2,sp.name[i])
-
-}
-
-#Add legend
-legend(0,5.17,c('Clearcut','Shelter','Patch Cut','Single-tree','No Harvest'),cex=0.8,
- lwd=2,col=cols[c(2,4,3,5,1)],bg="white",lty=ltys,ncol=3)
-
-
-dev.off()
-
diff --git a/presentations/figure_mistnet_counts.R b/presentations/figure_mistnet_counts.R
deleted file mode 100644
index a7c921c..0000000
--- a/presentations/figure_mistnet_counts.R
+++ /dev/null
@@ -1,26 +0,0 @@
-mist <- read.csv('data/mistnets_2015.csv',header=T)
-
-counts <- sort(summary(mist$Species),decreasing=T)
-
-codes <- c('WEWA','REVI','HOWA','WEVI','YBCH','GRCA','SCTA','KEWA','OVEN')
-
-colors <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255))
-
-colors.sub <- c(rep(colors[1],2),rep(colors[2],4),colors[1])
-
-
-png(filename="presentations/images/mistnet_counts.png",width=6,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mgp=c(3,1,0),mar = c(4.5,4.5,1,1) + 0.1,oma=c(0,0,0,0))
-
-x <- barplot(counts[1:7],ylim=c(0,300),ylab='Number of Captures (2015)',col=colors.sub,
- names=codes[1:7],xlab='Species')
-
-legend('topright',legend=c('Mature Forest','Early Successional'),
- fill=colors[1:2])
-
-dev.off()
-
diff --git a/presentations/figure_mu_bhco_abun.R b/presentations/figure_mu_bhco_abun.R
deleted file mode 100644
index 8e2f174..0000000
--- a/presentations/figure_mu_bhco_abun.R
+++ /dev/null
@@ -1,59 +0,0 @@
-colors <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255))
-lty <- c(1,1,1)
-pch <- c(17:19)
-
-#Set up figure container
-png(filename="presentations/images/mu_bhco_abun.png",width=6,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mgp=c(3,1,0),mar = c(4.5,4.5,1,1) + 0.1,oma=c(0,0,0,0))
-
-ind <- which(species=='BHCO')
-
-qu <- function(x){as.numeric(quantile(x,0.84,na.rm=T))}
-ql <- function(x){as.numeric(quantile(x,0.16,na.rm=T))}
-
-
-abun.mean <- abun.lower <- abun.upper <- matrix(NA,nrow=3,ncol=10)
-for (i in 1:3){
- abun.mean[i,] <- colMeans(Ntreat[,,i,ind])/3.14
- abun.upper[i,] <- apply(Ntreat[,,i,ind],2,qu)/3.14
- abun.lower[i,] <- apply(Ntreat[,,i,ind],2,ql)/3.14
-}
-
-figmax <- max(abun.upper,na.rm=T)*1.05
-figmin <- min(abun.lower,na.rm=T)*0.9
-
-plot(1:10,abun.mean[1,],main="",type='o',cex=2,lty=1,col=colors[1],
- lwd=2,pch=17,xaxt='n',xlab="Year",
- ylab=expression(paste("Density (birds ha"^{-1},")")),
- xlim=c(0.5,10.5),ylim=c(figmin,figmax))
-
-axis(side=1,at=c(1,3,5,7,9),
- labels=c('2006', '2008', '2010','2012','2014'),tck=0)
-
-wd=0.1
-for (i in 1:10){
- for (j in 1:3){
- segments(i,abun.lower[j,i],i,abun.upper[j,i])
- segments(i-wd,abun.lower[j,i],i+wd,abun.lower[j,i])
- segments(i-wd,abun.upper[j,i],i+wd,abun.upper[j,i])
- }
- }
-
-for (i in 1:3){
- lines(1:10,abun.mean[i,],type='o',cex=2,lty=lty[i],col=colors[i],lwd=2,pch=pch[i])
- lines(c(7,9),abun.mean[i,c(7,9)],lty=lty[i],col=colors[i],lwd=2)
-}
-
-abline(v=3.5,lty=2)
-
-
-legendtx <- c('No Harvest','Even-Aged','Uneven-Aged')
-
-legend('topright',legendtx,cex=1,
- pch=pch,lwd=2,col=colors,bg="white",lty=lty)
-
-dev.off() \ No newline at end of file
diff --git a/presentations/figure_rubus.R b/presentations/figure_rubus.R
deleted file mode 100644
index 8453925..0000000
--- a/presentations/figure_rubus.R
+++ /dev/null
@@ -1,39 +0,0 @@
-birds <- read.csv('data/mistnets_2015.csv',header=T)
-birds$Date <- as.Date(as.character(birds$Date), "%m/%d/%y")
-
-birds.scta <- birds[birds$Species=='Scarlet Tanager',]
-
-scta.sum <- aggregate(birds.scta$Age,list(Date=birds.scta$Session, Location=birds.scta$Location),length,
- drop=FALSE)
-
-scta.sum$Date <- aggregate(birds.scta$Date,list(Session=birds.scta$Session,Location=birds.scta$Location),mean,drop=FALSE)$x
-
-scta.sum <- scta.sum[order(scta.sum$Date),]
-
-veg <- read.csv('data/mistnet_veg.csv',header=T)
-veg$Date <- as.Date(as.character(veg$Date), "%m/%d/%Y")
-
-veg.sort <- veg[order(veg$Date),]
-
-png(filename="presentations/images/rubus_scta.png",width=6,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mgp=c(3,1,0),mar = c(4.5,4.5,1,4.5) + 0.1,oma=c(0,0,0,0))
-plot(veg.sort$Date,veg.sort$Rubus,type='l',lwd=3,col=rgb(244,124,66,max=255),
- xlab='Date',ylab='Rubus Index')
-par(new=TRUE)
-plot(scta.sum$Date,scta.sum$x,type='l',lwd=3,col=rgb(128,194,0,max=255),xaxt='n',yaxt='n',
- xlab='',ylab="")
-axis(4)
-mtext("SCTA Captures",side=4,line=3)
-
-legend('topleft',legend=c('Rubus Index','SCTA Captures'),
- col=c(rgb(244,124,66,max=255),rgb(128,194,0,max=255)),lwd=2)
-
-require(png)
-rub <- readPNG('presentations/images/rubus.png')
-tan <- readPNG('presentations/images/scta.png')
-rasterImage(rub, scta.sum$Date[1],5,scta.sum$Date[1]+30,10)
-rasterImage(tan,scta.sum$Date[22]-5,10,scta.sum$Date[22]+15,13)
-
-dev.off()
diff --git a/presentations/figures_fscc2016.R b/presentations/figures_fscc2016.R
new file mode 100644
index 0000000..e542e13
--- /dev/null
+++ b/presentations/figures_fscc2016.R
@@ -0,0 +1,231 @@
+#################################
+## Figures from FSCC 2016 Talk ##
+#################################
+
+#Load data and figure functions
+load('output/mu_bird_abun.Rdata')
+load('output/hl_bird_abun.Rdata')
+source('figures/figure_multidens.R')
+source('figures/figure_richness.R')
+source('figures/figure_birddens.R')
+
+#Load color palette
+cols.mu <- c(rgb(128,194,0,max=255),
+ rgb(244,124,66,max=255),
+ rgb(241,194,50,max=255))
+
+cols.hl <- c(rgb(128,194,0,max=255),
+ rgb(244,124,66,max=255),
+ rgb(241,194,50,max=255),
+ rgb(248, 172, 135,max=255),
+ rgb(255, 212, 128,max=255))
+
+##################################################################
+#BACI Simulation Figure
+
+#Simulate data
+set.seed(2016)
+control <- rnorm(10,0.3,0.05)
+treatment <- c(rnorm(3,0.3,0.05),rnorm(7,1,0.1))
+
+png(filename="presentations/images/baci.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+par(mgp=c(3,1,0),mar = c(4.5,4.5,1,1) + 0.1,oma=c(0,0,0,0))
+structure <- c(1:10)
+plot(structure,treatment,type='l',col=cols.mu[2],lwd=2,ylim=c(0,1.5),
+ xlab='Year',ylab='Density')
+
+lines(structure,control,col=cols.mu[1],lwd=2)
+abline(v=3.5,lty=2)
+
+text(3,1,'Treatment Applied',srt=90)
+text(mean(c(0.5,3.5)),0.1,'Before',font=2)
+text(mean(c(3.5,10.5)),0.1,'After',font=2)
+
+arrows(7,0.7,7,control[7]+0.05,length=0.1,lwd=2)
+arrows(7,0.7,7,treatment[7]-0.05,length=0.1,lwd=2)
+
+arrows(2,0.33,2,control[2]+0.01,length=0.05,lwd=2)
+arrows(2,0.33,2,treatment[2]-0.01,length=0.05,lwd=2)
+
+legend('topright',col=cols[1:2],lwd=2,legend=c('Control','Treatment'))
+
+dev.off()
+
+#################################################################
+#Species Response Summary Figure - Management Scale
+
+
+
+
+
+#################################################################
+#Species Response Summary Figure - Harvest Scale
+
+
+
+
+
+##################################################################
+#Abundance figures
+
+#Species to include
+sp.es <- c('EATO','INBU',
+ 'CARW','YBCH')
+sp.name.es <- c('Eastern Towhee','Indigo Bunting','Carolina Wren','Yellow-breasted Chat')
+
+sp.mf <- c('OVEN','WOTH',
+ 'WEWA','CERW')
+sp.name.mf <- c('Ovenbird','Wood Thrush','Worm-eating Warbler','Cerulean Warbler')
+
+##################################################
+#Early Successional Species, Management Unit Scale
+
+png(filename="presentations/images/mu_abun_es.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+multidens.figure(sp.es,sp.name.es,scale='mu',nrow=2,ncol=2,maxy=2,
+ yticks=c(0.5,1,1.5),legendpos=c(2,1),
+ cols=cols.mu,ltys=rep(1,3),lwd=2)
+
+dev.off()
+
+###################################################
+#Early Successional Species, Harvest Scale
+
+png(filename="presentations/images/hl_abun_es.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+multidens.figure(sp.es,sp.name.es,scale='hl',nrow=2,ncol=2,maxy=6.5,
+ yticks=1:6,legendpos=c(1,1),
+ cols=cols.hl,ltys=rep(1,5),lwd=2)
+
+dev.off()
+
+###################################################
+#Mature Forest Species, Management Unit Scale
+
+png(filename="presentations/images/mu_abun_mf.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+multidens.figure(sp.mf,sp.name.mf,scale='mu',nrow=2,ncol=2,maxy=4,
+ yticks=1:3,legendpos=c(2,1),
+ cols=cols.mu,ltys=rep(1,3),lwd=2)
+
+dev.off()
+
+###################################################
+#Mature Forest Species, Harvest Scale
+
+png(filename="presentations/images/hl_abun_mf.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+multidens.figure(sp.mf,sp.name.mf,scale='hl',nrow=2,ncol=2,maxy=6,
+ yticks=1:5,legendpos=c(2,1),
+ cols=cols.hl,ltys=rep(1,5),lwd=2)
+
+dev.off()
+
+####################################################
+#Richness, Management Scale
+
+png(filename="presentations/images/mu_rich.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+richness.figure(scale='mu',figmin=16.5,figmax=29,cols=cols.mu,pchs=17:19,ltys=rep(1,3))
+
+dev.off()
+
+#####################################################
+#Richness, Harvest Scale
+
+png(filename="presentations/images/hl_rich.png",width=5,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+richness.figure(scale='hl',figmin=16.5,figmax=32,cols=cols.hl,pchs=c(17,15,16,18,21),ltys=rep(1,5))
+
+dev.off()
+
+#####################################################
+#BHCO Density Figure
+
+png(filename="presentations/images/mu_bhco_abun.png",width=6,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+bird.figure('BHCO',scale='mu',cred=T,
+ ylab=expression(paste("Density (birds ha"^{-1},")")),
+ color=cols.mu,title='')
+
+dev.off()
+
+#####################################################
+#Ruhl Bird Mist Net Captures in Clearcuts Figure
+
+#Read in data
+mist <- read.csv('data/mistnets_2015.csv',header=T)
+counts <- sort(summary(mist$Species),decreasing=T)
+
+codes <- c('WEWA','REVI','HOWA','WEVI','YBCH','GRCA','SCTA','KEWA','OVEN')
+
+colors.sub <- c(rep(cols.mu[1],2),rep(cols.mu[2],4),cols.mu[1])
+
+png(filename="presentations/images/mistnet_counts.png",width=6,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+#Set up plot
+par(mgp=c(3,1,0),mar = c(4.5,4.5,1,1) + 0.1,oma=c(0,0,0,0))
+x <- barplot(counts[1:7],ylim=c(0,300),ylab='Number of Captures (2015)',col=colors.sub,
+ names=codes[1:7],xlab='Species')
+legend('topright',legend=c('Mature Forest','Early Successional'),
+ fill=cols.mu[1:2])
+
+dev.off()
+
+#####################################################
+#Rubus/SCTA Figure
+
+#Read in SCTA data
+birds <- read.csv('data/mistnets_2015.csv',header=T)
+birds$Date <- as.Date(as.character(birds$Date), "%m/%d/%y")
+birds.scta <- birds[birds$Species=='Scarlet Tanager',]
+
+#Organize by date/session
+scta.sum <- aggregate(birds.scta$Age,
+ list(Date=birds.scta$Session, Location=birds.scta$Location),length,
+ drop=FALSE)
+scta.sum$Date <- aggregate(birds.scta$Date,list(Session=birds.scta$Session,
+ Location=birds.scta$Location),mean,drop=FALSE)$x
+scta.sum <- scta.sum[order(scta.sum$Date),]
+
+#Read in veg data
+veg <- read.csv('data/mistnet_veg.csv',header=T)
+veg$Date <- as.Date(as.character(veg$Date), "%m/%d/%Y")
+veg.sort <- veg[order(veg$Date),]
+
+png(filename="presentations/images/rubus_scta.png",width=6,height=4,units="in",res=400, pointsize=10,
+ type='cairo')
+
+#Set up plot
+par(mgp=c(3,1,0),mar = c(4.5,4.5,1,4.5) + 0.1,oma=c(0,0,0,0))
+plot(veg.sort$Date,veg.sort$Rubus,type='l',lwd=3,col=cols.mu[1],
+ xlab='Date',ylab='Rubus Index')
+par(new=TRUE)
+plot(scta.sum$Date,scta.sum$x,type='l',lwd=3,col=cols.mu[2],xaxt='n',yaxt='n',
+ xlab='',ylab="")
+axis(4)
+mtext("SCTA Captures",side=4,line=3)
+
+legend('topleft',legend=c('Rubus Index','SCTA Captures'),
+ col=cols.mu[1:2],lwd=2)
+
+require(png)
+rub <- readPNG('presentations/images/rubus.png')
+tan <- readPNG('presentations/images/scta.png')
+rasterImage(rub, scta.sum$Date[1],5,scta.sum$Date[1]+30,10)
+rasterImage(tan,scta.sum$Date[22]-5,10,scta.sum$Date[22]+15,13)
+
+dev.off()
+
+
+
diff --git a/presentations/figures_richness.R b/presentations/figures_richness.R
deleted file mode 100644
index 0160389..0000000
--- a/presentations/figures_richness.R
+++ /dev/null
@@ -1,139 +0,0 @@
-###################################
-## Richness Presentation Figures ##
-###################################
-
-#Generate Rtreat arrays, if necessary
-#source(/figures/script_gen_treat_arrays.R)
-
-##################################################
-## Richness Figure for Management Spatial Scale ##
-##################################################
-
-#Set plotting options
-#colors = gray(seq(0.1,0.4,length=3))
-colors <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255))
-figmax <- 34
-figmin <- 18
-pch <- c(17:19)
-lty <- c(1,1,1)
-
-#Functions to calculate 95% CI
-qu <- function(x){as.numeric(quantile(x,0.975,na.rm=T))}
-ql <- function(x){as.numeric(quantile(x,0.025,na.rm=T))}
-
-#Calculate treatment x year means
-rich.means <- rich.upper <- rich.lower <- matrix(NA,nrow=3,ncol=10)
-
-for (i in 1:3){
- rich.means[i,] <- colMeans(Rtreat[,,i])
- rich.lower[i,] <- apply(Rtreat[,,i],2,ql)
- rich.upper[i,] <- apply(Rtreat[,,i],2,qu)
-}
-
-#Set up plot
-png(filename="presentations/images/mu_rich.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mar = c(4,3.5,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(2.5,1,0))
-plot(1:10,rich.means[1,],ylim=c(figmin,figmax),
- main="",type='o',cex=2,lty=lty[1],col=colors[1],
- lwd=2,pch=pch[1],xaxt='n',xlab="Year",ylab='Richness',
- xlim=c(0.5,10.5))
-axis(side=1,at=c(1,3,5,7,9), labels=c('2006', '2008', '2010','2012','2014'),tck=0)
-
-#Error bars
-wd=0.1
-for (i in 1:10){
- for (j in 1:3){
- segments(i,rich.lower[j,i],i,rich.upper[j,i])
- segments(i-wd,rich.lower[j,i],i+wd,rich.lower[j,i])
- segments(i-wd,rich.upper[j,i],i+wd,rich.upper[j,i])
- }
-}
-
-#Draw lines
-for (j in 1:3){
- lines(1:10,rich.means[j,],type='o',cex=2,lty=lty[j],col=colors[j],
- lwd=2,pch=pch[j])
- lines(c(7,9),rich.means[j,c(7,9)],lty=lty[j],col=colors[j],lwd=2)
-}
-
-#Draw vertical line at time of harvest
-abline(v=3.5,lty=2)
-
-#Add legend
-legend('topleft',c('No Harvest','Even-Aged','Uneven-Aged'),cex=1,
- pch=pch,lwd=2,col=colors,bg="white",lty=lty)
-
-dev.off()
-
-###############################################
-## Richness Figure for Harvest Spatial Scale ##
-###############################################
-#Set plotting options
-
-#colors <- gray(c(0,0.7,0.5,0.4,0.2))
-
-colors <- c(rgb(128,194,0,max=255),
- rgb(244,124,66,max=255),
- rgb(241,194,50,max=255),
- rgb(248, 172, 135,max=255),
- rgb(255, 212, 128,max=255)
-)
-
-figmax <- 40
-figmin <- 18
-pch <- c(17,15,16,18,21)
-lty <- c(1:5)
-
-#Functions to calculate 95% CI
-qu <- function(x){as.numeric(quantile(x,0.975,na.rm=T))}
-ql <- function(x){as.numeric(quantile(x,0.025,na.rm=T))}
-
-#Calculate treatment x year means
-rich.means <- rich.upper <- rich.lower <- matrix(NA,nrow=5,ncol=10)
-
-for (i in 1:5){
- rich.means[i,] <- colMeans(Rtreat.harvest[,,i])
- rich.lower[i,] <- apply(Rtreat.harvest[,,i],2,ql)
- rich.upper[i,] <- apply(Rtreat.harvest[,,i],2,qu)
-}
-
-#Set up plot
-png(filename="presentations/images/hl_rich.png",width=5,height=4,units="in",res=400, pointsize=10,
- type='cairo')
-
-par(mar = c(4,3.5,0.5,1) + 0.1, oma=c(0,0,0,0),mgp=c(2.5,1,0))
-plot(1:10,rich.means[1,],ylim=c(figmin,figmax),
- main="",type='o',cex=2,lty=lty[1],col=colors[1],
- lwd=2,pch=pch[1],xaxt='n',xlab="Year",ylab='Richness',
- xlim=c(0.5,10.5))
-axis(side=1,at=c(1,3,5,7,9), labels=c('2006', '2008', '2010','2012','2014'),tck=0)
-
-#Error bars
-wd=0.1
-for (i in 1:10){
- for (j in 1:5){
- segments(i,rich.lower[j,i],i,rich.upper[j,i])
- segments(i-wd,rich.lower[j,i],i+wd,rich.lower[j,i])
- segments(i-wd,rich.upper[j,i],i+wd,rich.upper[j,i])
- }
-}
-
-#Draw lines
-for (j in c(1,2,4,3,5)){
- lines(1:10,rich.means[j,],type='o',cex=2,lty=lty[j],col=colors[j],
- lwd=2,pch=pch[j])
- lines(c(7,9),rich.means[j,c(7,9)],lty=lty[j],col=colors[j],lwd=2)
-}
-
-#Draw vertical line at time of harvest
-abline(v=3.5,lty=2)
-
-#Add legend
-legend('topleft',c('Clearcut','Shelter','Patch Cut','Single-tree','No Harvest'),cex=1,
- pch=pch[c(2,4,3,5,1)],lwd=1,col=colors[c(2,4,3,5,1)],bg="white",lty=lty,ncol=3)
-
-dev.off() \ No newline at end of file
diff --git a/supplements/supplementS3.Rmd b/supplements/supplementS3.Rmd
index 9c38246..59d49af 100644
--- a/supplements/supplementS3.Rmd
+++ b/supplements/supplementS3.Rmd
@@ -55,7 +55,7 @@ species.sort <- order(species)
bird.figure(species[species.sort[index]],scale='mu',se=T,defaultpar=F,legendpos=legendpos,
legcex=1,ylab=ylab,
- title=cn[index])
+ title=cn[index],legend.lwd=1)
index <- index+1
}
@@ -91,7 +91,7 @@ while(index<42){
bird.figure(species[species.sort[index]],scale='mu',se=T,defaultpar=F,legendpos=legendpos,
legcex=1,ylab=ylab,
- title=cn[index])
+ title=cn[index],legend.lwd=1)
index <- index+1
}
@@ -131,7 +131,7 @@ while(index<5){
bird.figure(species[species.sort[index]],scale='hl',se=T,defaultpar=F,legendpos=legendpos,
legcex=1,ylab=ylab,
- title=cn[index])
+ title=cn[index],legend.lwd=1)
index <- index+1
}
@@ -150,7 +150,7 @@ par(mfrow=c(3,2),
while(index<42){
leginc <- c(2,5,11,20,26,34,35)
- legcode <- c(1,2,1,1,1,1,2,2)
+ legcode <- c(1,2,1,1,1,2,1,1)
if(index%in%leginc){
figind <- which(leginc==index)
@@ -169,7 +169,7 @@ while(index<42){
bird.figure(species[species.sort[index]],scale='hl',se=T,defaultpar=F,legendpos=legendpos,
legcex=1,ylab=ylab,
- title=cn[index])
+ title=cn[index],legend.lwd=1)
index <- index+1
}