plot_maturity_ogives: Create a plot containing the maturity ogives by year on a...

View source: R/plot-maturity-ogives.R

plot_maturity_ogivesR Documentation

Create a plot containing the maturity ogives by year on a single panel with inset for an area of interest to contain a detailed view

Description

Create a plot containing the maturity ogives by year on a single panel with inset for an area of interest to contain a detailed view

Usage

plot_maturity_ogives(
  show_inset = TRUE,
  from = c(xmin = 2, xmax = 6.5, ymin = 0.8, ymax = 1),
  to = c(xmin = 5, xmax = 14, ymin = 0.05, ymax = 0.6),
  x_breaks = sort(unique(d$age)),
  x_label_every_nth = 5,
  vert_lines = 5,
  vert_lines_type = "dashed",
  vert_lines_color = "grey20",
  vert_lines_thickness = 0.5,
  eq_line_color = "black",
  fore_line_color = "red",
  eq_x_start_legend = NULL,
  eq_y_start_legend = 0.1,
  eq_fore_alpha = 0.7,
  eq_fore_line_width = 3,
  leg_line_size_cm = 1,
  leg_font_size = 14,
  space_between_legend_items_cm = 0.5
)

Arguments

show_inset

Logical. If TRUE, show the inset panel

from

The limits of the inset on the main plot to extract. See ggmagnify::geom_magnify()

to

The limits on the main panel of the location to place the inset. See ggmagnify::geom_magnify()

x_breaks

A vector of values on the x axis to show ticks for

x_label_every_nth

Every nth value on the x axis, label the tick mark. So if this is 2, label every second tick age on the x axis

vert_lines

A vector of ages to draw vertical lines for, to aid the eye. If NULL, draw no lines.

vert_lines_type

Type of vertical lines if vert_lines is TRUE

vert_lines_color

Color of vertical lines if vert_lines is TRUE

vert_lines_thickness

Thickness of vertical lines if vert_lines is TRUE

eq_line_color

Color for the Equilibrium line

fore_line_color

Color for the Forecast line

eq_x_start_legend

X value where the legend for the Equilibrium line and the Forecast line starts. Will likely change each year. If NULL, the default of outside the plotting area, under the legend will be used

eq_y_start_legend

Y value where the legend for the Equilibrium line and the Forecast line starts. Will likely change each year

eq_fore_alpha

The transparency value for the Equilibrium and Forecast lines

eq_fore_line_width

The line width for the Equilibrium and Forecast lines

leg_line_size_cm

The legend line length in cm

leg_font_size

The legend font size

space_between_legend_items_cm

Vertical space in cm between the legend items

Details

The package data frame maturity_estimates_df is used. The 'Equilibrium' and 'Forecast' legend items are not part of the legend, they are annotated text and have to be placed manually if you change the size of this plot. use the arguments eq_x_start_legend and eq_y_start_legend to do so.

Value

A ggplot2::ggplot() object


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