Skip to content

Commit

Permalink
feature(plot_biomass): add annotation for reference line
Browse files Browse the repository at this point in the history
  • Loading branch information
Schiano-NOAA committed Dec 17, 2024
1 parent a92e893 commit 91a77c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/plot_biomass.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ plot_biomass <- function(
y = biomass_label) +
ggplot2::scale_x_continuous(
n.breaks = x_n_breaks,
guide = ggplot2::guide_axis(minor.ticks = TRUE))
guide = ggplot2::guide_axis(minor.ticks = TRUE)) +
+
ggplot2::annotate(
geom = "text",
x = end_year + 0.05,
y = ref_line_val / ifelse(relative, ref_line_val, scale_amount),
label = list(bquote(B[.(ref_line)])),
parse = TRUE
)

plt_fin <- add_theme(plt)

Expand Down

0 comments on commit 91a77c3

Please sign in to comment.