diff insect_phenology_model.R @ 48:66712cdec7c0 draft

Uploaded
author greg
date Mon, 13 Nov 2017 11:05:42 -0500
parents d6482112bf35
children d03ba99e25b6
line wrap: on
line diff
--- a/insect_phenology_model.R	Mon Nov 13 10:53:31 2017 -0500
+++ b/insect_phenology_model.R	Mon Nov 13 11:05:42 2017 -0500
@@ -579,62 +579,62 @@
 # SE for F2 adult
 g2a.se <- apply(g2a.rep, 1, sd) / sqrt(opt$replications)
 
-dev.new(width=20, height=20)
+dev.new(width=20, height=30)
 
 # Start PDF device driver to save charts to output.
-pdf(file=opt$output, height=20, width=20, bg="white")
+pdf(file=opt$output, width=20, height=30, bg="white")
 
 par(mar = c(5, 6, 4, 4), mfrow=c(3, 1))
 
 # Subfigure 2: population size by life stage
 title <- paste("BSMB Total Population Size by Life Stage:", opt$location, ", Latitude:", latitude, ", Temperature Dates:", start_date, "to", end_date, sep=" ")
-plot(day.all, sa, main=title, type="l", ylim=c(0, max(se + se.se, sn + sn.se, sa + sa.se)), axes=F, lwd=2, xlab="", ylab="Number", cex=2, cex.lab=2, cex.axis=2, cex.main=2)
+plot(day.all, sa, main=title, type="l", ylim=c(0, max(se + se.se, sn + sn.se, sa + sa.se)), axes=F, lwd=2, xlab="", ylab="Number", cex=3, cex.lab=2, cex.axis=2, cex.main=2)
 # Young and old nymphs.
 lines(day.all, sn, lwd=2, lty=1, col=2)
 # Eggs
 lines(day.all, se, lwd=2, lty=1, col=4)
 axis(1, at = c(1:12) * 30 - 15, cex.axis=2, labels=c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"))
-axis(2, cex.axis = 2)
+axis(2, cex.axis = 3)
 leg.text <- c("Egg", "Nymph", "Adult")
-legend("topleft", leg.text, lty=c(1, 1, 1), col=c(4, 2, 1), cex=2)
+legend("topleft", leg.text, lty=c(1, 1, 1), col=c(4, 2, 1), cex=3)
 if (opt$se_plot == 1) {
-    # add SE lines to plot
+    # Add SE lines to plot
     # SE for adults
     lines (day.all, sa + sa.se, lty=2)
     lines (day.all, sa - sa.se, lty=2) 
     # SE for nymphs
     lines (day.all, sn + sn.se, col=2, lty=2)
-    lines (day.all, sn - sn.se, col=2, lty=2) 
+    lines (day.all, sn - sn.se, col=2, lty=2)
     # SE for eggs
     lines (day.all, se + se.se, col=4, lty=2)
-    lines (day.all, se - se.se, col=4, lty=2) 
+    lines (day.all, se - se.se, col=4, lty=2)
 }
 
 # Subfigure 3: population size by generation
 title <- paste("BSMB Total Population Size by Generation:", opt$location, ", Latitude:", latitude, ", Temperature Dates:", start_date, "to", end_date, sep=" ")
-plot(day.all, g0, main=title, type="l", ylim=c(0, max(g2)), axes=F, lwd=2, xlab="", ylab="Number", cex=2, cex.lab=2, cex.axis=2, cex.main=2)
+plot(day.all, g0, main=title, type="l", ylim=c(0, max(g2)), axes=F, lwd=2, xlab="", ylab="Number", cex=3, cex.lab=2, cex.axis=2, cex.main=2)
 lines(day.all, g1, lwd = 2, lty = 1, col = 2)
 lines(day.all, g2, lwd = 2, lty = 1, col = 4)
 axis(1, at = c(1:12) * 30 - 15, cex.axis = 2, labels = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"))
-axis(2, cex.axis = 2)
+axis(2, cex.axis = 3)
 leg.text <- c("P", "F1", "F2")
 legend("topleft", leg.text, lty = c(1, 1, 1), col =c(1, 2, 4), cex = 2)
 if (opt$se_plot == 1) {
-    # add SE lines to plot
+    # Add SE lines to plot
     # SE for adults
     lines (day.all, g0 + g0.se, lty = 2)
     lines (day.all, g0 - g0.se, lty = 2) 
     # SE for nymphs
     lines (day.all, g1 + g1.se, col = 2, lty = 2)
-    lines (day.all, g1 - g1.se, col = 2, lty = 2) 
+    lines (day.all, g1 - g1.se, col = 2, lty = 2)
     # SE for eggs
     lines (day.all, g2 + g2.se, col = 4, lty = 2)
-    lines (day.all, g2 - g2.se, col = 4, lty = 2) 
+    lines (day.all, g2 - g2.se, col = 4, lty = 2)
 }
 
 # Subfigure 4: adult population size by generation
 title <- paste("BSMB Adult Population Size by Generation:", opt$location, ", Latitude:", latitude, ", Temperature Dates:", start_date, "to", end_date, sep=" ")
-plot(day.all, g0a, ylim=c(0, max(g2a) + 100), main=title, type="l", axes=F, lwd=2, xlab="Year", ylab="Number", cex=2, cex.lab=2, cex.axis=2, cex.main=2)
+plot(day.all, g0a, ylim=c(0, max(g2a) + 100), main=title, type="l", axes=F, lwd=2, xlab="Year", ylab="Number", cex=3, cex.lab=2, cex.axis=2, cex.main=2)
 lines(day.all, g1a, lwd = 2, lty = 1, col = 2)
 lines(day.all, g2a, lwd = 2, lty = 1, col = 4)
 axis(1, at = c(1:12) * 30 - 15, cex.axis = 2, labels = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"))
@@ -642,16 +642,16 @@
 leg.text <- c("P", "F1", "F2")
 legend("topleft", leg.text, lty = c(1, 1, 1), col = c(1, 2, 4), cex = 2)
 if (opt$se_plot == 1) {
-    # add SE lines to plot
+    # Add SE lines to plot
     # SE for adults
     lines (day.all, g0a + g0a.se, lty = 2)
     lines (day.all, g0a - g0a.se, lty = 2) 
     # SE for nymphs
     lines (day.all, g1a + g1a.se, col = 2, lty = 2)
-    lines (day.all, g1a - g1a.se, col = 2, lty = 2) 
+    lines (day.all, g1a - g1a.se, col = 2, lty = 2)
     # SE for eggs
     lines (day.all, g2a + g2a.se, col = 4, lty = 2)
-    lines (day.all, g2a - g2a.se, col = 4, lty = 2) 
+    lines (day.all, g2a - g2a.se, col = 4, lty = 2)
 }
 
 # Turn off device driver to flush output.