plot_survey_fit_mcmc: Creates a plot of fits to survey biomass including individual...

View source: R/plot-survey-fit-mcmc.R

plot_survey_fit_mcmcR Documentation

Creates a plot of fits to survey biomass including individual posterior lines, median posterior line, observed values, and estimated values

Description

Creates a plot of fits to survey biomass including individual posterior lines, median posterior line, observed values, and estimated values

Usage

plot_survey_fit_mcmc(
  model,
  type = c("age1", "acoustic"),
  n_posts = NULL,
  show_legend = TRUE,
  x_lim = c(survey_start_yr, survey_end_yr),
  y_lim = c(0, 5),
  x_labs_mod = 5,
  y_labs_by = 0.5,
  tick_prop = 1,
  vjust_x_labels = -1.5,
  remove_yr_labels = NULL,
  post_line_width = 0.1,
  post_line_col = "black",
  post_line_alpha = 0.1,
  post_med_line_width = 1,
  post_med_line_color = "royalblue",
  post_med_line_alpha = main_alpha,
  post_med_point_size = 1.5,
  post_line_gap = ts_linegap,
  obs_line_width = 1.5,
  obs_line_color = "black",
  obs_point_color = "black",
  obs_point_size = 2.5,
  obs_alpha = 1,
  extrasd_line_width = 0.5,
  extrasd_line_color = "black",
  extrasd_point_color = "royalblue",
  extrasd_point_size = 2,
  extrasd_alpha = 1,
  glow = FALSE,
  glow_offset = 0.25,
  glow_color = "black",
  glow_alpha = 1,
  leg_ymax = y_lim[2] - 0.25,
  leg_sep = 0.6,
  leg_font_size = 10/.pt,
  ...
)

Arguments

model

A model object, , created by create_rds_file()

type

One of the surveys, either age1 or acoustic

n_posts

The number of posterior lines to plot. The lines are randomly drawn from all posteriors. if this is larger than the number of posteriors, all posterior lines will be shown

show_legend

Logical. If TRUE, show the legend

x_lim

A vector of two for the minimum and maximum values for the x-axis on the plot

y_lim

A vector of two for the minimum and maximum values for the y-axis on the plot

x_labs_mod

How many years between year labels on the x-axis

y_labs_by

How often to have a label on the y-axis

tick_prop

A value that the length of the major tick marks are multiplied by. This proportion must be set by trial and error. Make sure to change vjust_x_labels so the labels are not overlapping the lines or are too far away from the lines

vjust_x_labels

Adjustment to move the x-axis tick labels and label up or down. Negative numbers move down

remove_yr_labels

A vector of years to remove the ,labels for in case they are overlapping

post_line_width

The width of the posterior lines

post_line_col

The color of the thinner individual posterior lines

post_line_alpha

The transparency of the thinner individual posterior lines

post_med_line_width

The width of the posterior median line

post_med_line_color

The color of the posterior median line

post_med_line_alpha

The transparency of the posterior median line

post_med_point_size

The size of the posterior median points

post_line_gap

The line gap value (separation between points and the line connecting them)

obs_line_width

The width of the error bar lines for observed values

obs_line_color

the color for the uncertainty bars for the observed values

obs_point_color

the color for the uncertainty median points for the observed values

obs_point_size

The size of the points on the error bars for the observed values

obs_alpha

The transparency of the observed lines

extrasd_line_width

The width of the error bar lines for the extra SD parameter estimates

extrasd_line_color

The color of the error bars for the extra SD parameter estimates

extrasd_point_color

The color of the median points for the extra SD parameter estimates

extrasd_point_size

The sizeof the median points for the extra SD parameter estimates

extrasd_alpha

The transparency of the extra SD lines

glow

Logical. If TRUE, add a glow around the lines so that they can more easily be seen in contrast to the background posterior lines

glow_offset

The amount to add to the lines and points to create the

glow_color

The color to use for the "glow" effect around lines

glow_alpha

The transparency to use for the "glow" effect around lines

leg_ymax

The top right y value for drawing the white box under the legend

leg_sep

The amount to seperate each entry in the legend. Needed because the legend is manually made

Details

Uses the probs vector which is included in the package data for this package

Value

a ggplot2::ggplot() object


pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.