plot_timeseries: Plot time series data from an MSE or OM simulation run

View source: R/plot_timeseries.R

plot_timeseriesR Documentation

Plot time series data from an MSE or OM simulation run

Description

Plot time series data from an MSE or OM simulation run

Usage

plot_timeseries(
  ps = NULL,
  type = "ssb",
  time = "mid",
  ci = c(0.05, 0.95),
  by_country = FALSE,
  yr_lim = c(NA_real_, NA_real_),
  ylim = c(NA_real_, NA_real_),
  ci_lines = TRUE,
  show_ci = TRUE,
  show_ssb0 = TRUE,
  show_hcr = TRUE,
  show_hcr_values = TRUE,
  show_y_values = TRUE,
  rev_scenarios = FALSE,
  legend_position = c(0.26, 0.85),
  ssb_line_txt_cex = 0.8,
  ssb_line_col = "black",
  ssb_line_type = 2,
  ...
)

Arguments

ps

A plot setup object as output by setup_mse_plot_objects().

type

One of 'ssb', 'ssb_ssb0', catch', 'recr', aas', 'aac','aap'

time

Either 'beg' for beginning of the year SSB or 'mid' for mid-year SSB. Only used if type is 'ssb' or 'ssb_ssb0'.

ci

A vector of length two of the lower and upper credible interval values.

by_country

If TRUE, the plot will be N panels of plots comparing the scenarios by country. N is the number of scenarios. If FALSE the plot will be one panel comparing the scenarios.

yr_lim

A vector of 2 for minimum and maximum yrs to show on the plot. If either are NA, the limits of the data are used.

ylim

A vector of 2 for limits of the y-axis. If either are NA, the limits of the data are used.

ci_lines

If TRUE, use dashed lines for the CI envelope. If FALSE, use a shaded ribbon.

show_ci

If TRUE, show the confidence interval, if FALSE, only show the median

show_ssb0

If TRUE, show the initial biomass, SSB0 line. Only used if type is 'ssb' or 'ssb_ssb0'.

show_hcr

If TRUE, show the 0.4 initial biomass and 0.1 initial biomass lines. Only used if type is 'ssb' or 'ssb_ssb0'.

show_hcr_values

If TRUE, show the SSB values for the HCR lines in the margin Only used if type is 'ssb' or 'ssb_ssb0'.

show_y_values

If TRUE, show the Y-axis values

rev_scenarios

If TRUE, reverse the order of the scenarios in the legend.

legend_position

A vector of two - X and Y position for the legend. See ggplot2::theme()

ssb_line_txt_cex

Size multiplier for SSB reference point line labels.

ssb_line_col

Color for SSB reference point line labels.

ssb_line_type

Line type for SSB reference point line labels.

...

Extra arguments to pass to color_facet_backgrounds()

Value

A ggplot2::ggplot() object


pacific-hake/pacifichakemse documentation built on June 11, 2024, 4:07 a.m.