Skip to content

Commit

Permalink
adds recent 10 yr shading
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaichas committed Feb 29, 2024
1 parent 59c50ba commit 82e67fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions R/plot_grayseal.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ plot_grayseal <- function(shadedRegion = NULL,
p <- ecodata::grayseal |>
dplyr::filter(Var %in% c("pbr", "totalest5y", "totalest1y")) |>
ggplot2::ggplot()+
#Highlight last ten years
ggplot2::annotate("rect", fill = setup$shade.fill, alpha = setup$shade.alpha,
xmin = setup$x.shade.min , xmax = setup$x.shade.max,
ymin = -Inf, ymax = Inf) +
ggplot2::geom_line(ggplot2::aes(x = Time, y = Value, linetype = Var, color = Var))+
ggplot2::geom_ribbon(data = ribbon, ggplot2::aes(ymin = total5yLCI, ymax =total5yUCI, x = Time), fill = "blue", alpha = 0.2)+
ggplot2::ggtitle("Gray Seal Bycatch")+
Expand Down
6 changes: 5 additions & 1 deletion R/plot_harborporpoise.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ plot_harborporpoise <- function(shadedRegion = NULL,
p <- ecodata::harborporpoise |>
dplyr::filter(Var %in% c("pbr", "totalest5y", "totalest1y")) |>
ggplot2::ggplot()+
#Highlight last ten years
ggplot2::annotate("rect", fill = setup$shade.fill, alpha = setup$shade.alpha,
xmin = setup$x.shade.min , xmax = setup$x.shade.max,
ymin = -Inf, ymax = Inf) +
ggplot2::geom_line(ggplot2::aes(x = Time, y = Value, linetype = Var, color = Var))+
ggplot2::geom_ribbon(data = ribbon, ggplot2::aes(ymin = total5yLCI, ymax =total5yUCI, x = Time), fill = "blue", alpha = 0.2)+
ggplot2::ggtitle("Harbor Porpoise Bycatch")+
Expand All @@ -50,7 +54,7 @@ plot_harborporpoise <- function(shadedRegion = NULL,
labels = c("PBR", "Annual Estimates", "5yr rolling mean and CI"))+
ggplot2::theme(#legend.position = "none",
legend.title = ggplot2::element_blank(),
legend.position = c(0.75, 0.8),
legend.position = c(0.5, 0.8),
legend.text = ggplot2::element_text(size = 8),
legend.background = ggplot2::element_rect(
colour = "transparent", fill = "transparent"))+
Expand Down

0 comments on commit 82e67fb

Please sign in to comment.