Skip to contents

Plots the median and quantiles of a time-series

Usage

plot_TS(
  x,
  xlab = "Year",
  ylab = "Spawning Biomass",
  title = "",
  quantiles = c(0.025, 0.975),
  scale = NULL,
  alpha = 0.1,
  lwd = 1,
  use_theme = NULL,
  colpalette = "Dark2",
  facet = TRUE,
  inc.Legend = !facet,
  inc.Hist = FALSE,
  print = TRUE,
  get_function = get_SSB,
  years = NULL,
  ...
)

plot_SSB(x, ...)

plot_Biomass(x, ylab = "Biomass", ...)

plot_Landings(x, ylab = "Landings", ...)

plot_Removals(x, ylab = "Removals", ...)

plot_Recruits(x, ylab = "Recruits", ...)

plot_F(x, ylab = "Fishing Mortality (F)", ...)

plot_LifeHistory(
  x,
  xlab = "Year",
  ylab = "Median (quantiles)",
  title = "",
  quantiles = c(0.025, 0.975),
  scale = NULL,
  alpha = 0.1,
  lwd = 1,
  use_theme = NULL,
  colpalette = "Dark2",
  facet = TRUE,
  inc.Legend = !facet,
  inc.Hist = FALSE,
  print = TRUE
)

Arguments

x

An object of class Hist, MSE, or a list of Hist or MSE objects

xlab

X-axis label (default 'Year')

ylab

Y-axes label

title

Optional title

quantiles

Lower and upper quantiles to calculate. Numeric vector of length 2.

scale

An optional function with a single numeric argument that returns transformed or scaled numeric values. See lb2kg and kg2lb for example. Can be a list of functions for list objects (NA for no transformation)

alpha

Transparency parameter

lwd

Line width

use_theme

Optional ggplot theme

colpalette

Color palette from RColorBrewer

facet

Logical. Facet the plot?

inc.Legend

Logical. Include legend?

inc.Hist

Logical. For MSE results, include the historical period?

print

Logical. Print the plot?

get_function

get_ function to extract time-series information from x

years

Optional numeric vector specifying the years to plot. Default is all years.

...

Named arguments passed to plot_TS

Value

A named list with:

pThe ggplot object
dfData.frame with the summary statistics (median and quantiles)

Functions

  • plot_SSB(): Plot the Spawning Biomass

  • plot_Biomass(): Plot the Total Biomass

  • plot_Landings(): Plot the Landings (biomass)

  • plot_Removals(): Plot the Removals (biomass)

  • plot_Recruits(): Plot the Recruits (numbers)

  • plot_F(): Plot the Recruits (numbers)

  • plot_LifeHistory(): Plot the Life-History parameters