txtcol <- 'black'
thrthm <- theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text.y = element_text(colour = txtcol, size = 12),
axis.title = element_blank(),
plot.title = element_text(size = 15, colour = txtcol),
legend.text = element_text(size = 12, colour = txtcol),
axis.text.x = element_text(size = 10, colour = txtcol, angle = 0, hjust = 0.5)
)
p1 <- show_boxplot(epcbs, bay_segment = "OTB", yrrng = yrrng, yrsel = maxyr, partialyr = T) + thrthm
p1leg <- g_legend(p1)
p1 <- p1 + theme(legend.position = 'none')
p2 <- show_boxplot(epcbs, bay_segment = "HB", yrrng = yrrng, yrsel = maxyr, partialyr = T) + thrthm + theme(legend.position = 'none')
p3 <- show_boxplot(epcbs, bay_segment = "MTB", yrrng = yrrng, yrsel = maxyr, partialyr = T) + thrthm + theme(legend.position = 'none')
p4 <- show_boxplot(epcbs, bay_segment = "LTB", yrrng = yrrng, yrsel = maxyr, partialyr = T) + thrthm + theme(legend.position = 'none')
# align
# Get the widths
pA <- ggplot_gtable(ggplot_build(p1))
pB <- ggplot_gtable(ggplot_build(p2))
pC <- ggplot_gtable(ggplot_build(p3))
pD <- ggplot_gtable(ggplot_build(p4))
maxWidth = grid::unit.pmax(pA$widths[2:3], pB$widths[2:3], pD$widths[2:3], pD$widths[2:3])
# Set the widths
pA$widths[2:3] <- maxWidth
pB$widths[2:3] <- maxWidth
pC$widths[2:3] <- maxWidth
pD$widths[2:3] <- maxWidth
grid.arrange(
arrangeGrob(
textGrob('Monthly chl-a (ug/L)', rot = 90, gp = gpar(fontsize = 20)),
arrangeGrob(
p1leg,
arrangeGrob(pA, pB, ncol = 2),
arrangeGrob(pC, pD, ncol = 2),
ncol = 1, heights = c(0.1, 1, 1)
), ncol = 2, widths = c(0.05, 1)
)
)

txtcol <- 'black'
thrthm <- theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text.y = element_text(colour = txtcol, size = 12),
axis.title = element_blank(),
plot.title = element_text(size = 15, colour = txtcol),
legend.text = element_text(size = 12, colour = txtcol),
axis.text.x = element_text(size = 10, colour = txtcol, angle = 0, hjust = 0.5)
)
p1 <- show_boxplot(epcbs, bay_segment = "OTB", yrrng = yrrng, yrsel = maxyr, partialyr = T, param = 'la') + thrthm
p1leg <- g_legend(p1)
p1 <- p1 + theme(legend.position = 'none')
p2 <- show_boxplot(epcbs, bay_segment = "HB", yrrng = yrrng, yrsel = maxyr, partialyr = T, param = 'la') + thrthm + theme(legend.position = 'none')
p3 <- show_boxplot(epcbs, bay_segment = "MTB", yrrng = yrrng, yrsel = maxyr, partialyr = T, param = 'la') + thrthm + theme(legend.position = 'none')
p4 <- show_boxplot(epcbs, bay_segment = "LTB", yrrng = yrrng, yrsel = maxyr, partialyr = T, param = 'la') + thrthm + theme(legend.position = 'none')
# align
# Get the widths
pA <- ggplot_gtable(ggplot_build(p1))
pB <- ggplot_gtable(ggplot_build(p2))
pC <- ggplot_gtable(ggplot_build(p3))
pD <- ggplot_gtable(ggplot_build(p4))
maxWidth = grid::unit.pmax(pA$widths[2:3], pB$widths[2:3], pD$widths[2:3], pD$widths[2:3])
# Set the widths
pA$widths[2:3] <- maxWidth
pB$widths[2:3] <- maxWidth
pC$widths[2:3] <- maxWidth
pD$widths[2:3] <- maxWidth
grid.arrange(
arrangeGrob(
textGrob('Monthly light attenuation (m-1)', rot = 90, gp = gpar(fontsize = 20)),
arrangeGrob(
p1leg,
arrangeGrob(pA, pB, ncol = 2),
arrangeGrob(pC, pD, ncol = 2),
ncol = 1, heights = c(0.1, 1, 1)
), ncol = 2, widths = c(0.05, 1)
)
)

txtcol <- 'black'
thrthm <- theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text.y = element_text(colour = txtcol, size = 12),
axis.title = element_blank(),
plot.title = element_text(size = 15, colour = txtcol),
legend.text = element_text(size = 12, colour = txtcol),
axis.text.x = element_text(size = 10, colour = txtcol, angle = 0, hjust = 0.5)
)
sclx <- scale_x_continuous(breaks = seq(1975, maxyr, by = 5))
p1 <- show_thrplot(epcdata, bay_segment = "OTB", thr = "chla", yrrng = yrrng, partialyr = T) + sclx + thrthm
p1leg <- g_legend(p1)
p1 <- p1 + theme(legend.positio = 'none')
p2 <- show_thrplot(epcdata, bay_segment = "HB", thr = "chla", yrrng = yrrng, partialyr = T) + sclx + thrthm + theme(legend.position = 'none')
p3 <- show_thrplot(epcdata, bay_segment = "MTB", thr = "chla", yrrng = yrrng, partialyr = T) + sclx + thrthm + theme(legend.position = 'none')
p4 <- show_thrplot(epcdata, bay_segment = "LTB", thr = "chla", yrrng = yrrng, partialyr = T) + sclx + thrthm + theme(legend.position = 'none')
# align
# Get the widths
pA <- ggplot_gtable(ggplot_build(p1))
pB <- ggplot_gtable(ggplot_build(p2))
pC <- ggplot_gtable(ggplot_build(p3))
pD <- ggplot_gtable(ggplot_build(p4))
maxWidth = grid::unit.pmax(pA$widths[2:3], pB$widths[2:3], pD$widths[2:3], pD$widths[2:3])
# Set the widths
pA$widths[2:3] <- maxWidth
pB$widths[2:3] <- maxWidth
pC$widths[2:3] <- maxWidth
pD$widths[2:3] <- maxWidth
grid.arrange(
arrangeGrob(
textGrob('Mean annual chl-a (ug/L)', rot = 90, gp = gpar(fontsize = 20)),
arrangeGrob(
p1leg,
arrangeGrob(pA, pB, ncol = 2),
arrangeGrob(pC, pD, ncol = 2),
ncol = 1, heights = c(0.1, 1, 1)
), ncol = 2, widths = c(0.05, 1)
)
)

txtcol <- 'black'
thrthm <- theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text.y = element_text(colour = txtcol, size = 12),
axis.title = element_blank(),
plot.title = element_text(size = 15, colour = txtcol),
legend.text = element_text(size = 12, colour = txtcol),
axis.text.x = element_text(size = 10, colour = txtcol, angle = 0, hjust = 0.5)
)
sclx <- scale_x_continuous(breaks = seq(1975, maxyr, by = 5))
p1 <- show_thrplot(epcdata, bay_segment = "OTB", thr = "la", yrrng = yrrng, partialyr = T) + sclx + thrthm
p1leg <- g_legend(p1)
p1 <- p1 + theme(legend.positio = 'none')
p2 <- show_thrplot(epcdata, bay_segment = "HB", thr = "la", yrrng = yrrng, partialyr = T) + sclx + thrthm + theme(legend.position = 'none')
p3 <- show_thrplot(epcdata, bay_segment = "MTB", thr = "la", yrrng = yrrng, partialyr = T) + sclx + thrthm + theme(legend.position = 'none')
p4 <- show_thrplot(epcdata, bay_segment = "LTB", thr = "la", yrrng = yrrng, partialyr = T) + sclx + thrthm + theme(legend.position = 'none')
# align
# Get the widths
pA <- ggplot_gtable(ggplot_build(p1))
pB <- ggplot_gtable(ggplot_build(p2))
pC <- ggplot_gtable(ggplot_build(p3))
pD <- ggplot_gtable(ggplot_build(p4))
maxWidth = grid::unit.pmax(pA$widths[2:3], pB$widths[2:3], pD$widths[2:3], pD$widths[2:3])
# Set the widths
pA$widths[2:3] <- maxWidth
pB$widths[2:3] <- maxWidth
pC$widths[2:3] <- maxWidth
pD$widths[2:3] <- maxWidth
grid.arrange(
arrangeGrob(
textGrob('Mean annual light attenuation (m-1)', rot = 90, gp = gpar(fontsize = 20)),
arrangeGrob(
p1leg,
arrangeGrob(pA, pB, ncol = 2),
arrangeGrob(pC, pD, ncol = 2),
ncol = 1, heights = c(0.1, 1, 1)
), ncol = 2, widths = c(0.05, 1)
)
)

wqmatrix
