plot_catches: Plot catch data as a stacked barplot

View source: R/plot-catches.R

plot_catchesR Documentation

Plot catch data as a stacked barplot

Description

Plot catch data as a stacked barplot

Usage

plot_catches(
  ct,
  leg_font_size = 12,
  leg_key_size = 0.7,
  leg_ratio = c(1, 2),
  clip_cover = 2,
  xlim = c(1966, year(Sys.time())),
  x_breaks = xlim[1]:xlim[2],
  x_expansion = 1,
  x_labs_mod = 5,
  ylim = c(0, 450),
  y_breaks = seq(0, 400, 100)
)

Arguments

ct

The data frame which is read in from landings-tac-history.csv

leg_font_size

The legend font size

leg_key_size

The size in cm of the bars of color in the legend

leg_ratio

A vector of length two, for the ratio of the legend size vs the plot size respectively. Default is c(1, 2). You will likely need to change this if changing leg_key_size and/or leg_font_size

clip_cover

There is a white rectangle drawn on top of the plot to cover any of the plot that made it outside the plot area. clip has to be set to off for the major x-axis tick marks to work, So, this is required. If you make the plot in a grid, the rectangle may overwrite some of the plot above it, and this number will have to be changed through trial and error until you cannot see the white rectangle anymore.

xlim

The year limits to plot

x_breaks

The year value tick marks to show for the x axis

x_expansion

Amount to expand the x axis. See the expand argument in ggplot2::scale_x_continuous()

x_labs_mod

Value for major X-axis tick marks. Every Nth tick will be longer and have a label. The first and last will be shown regardless of what this number is

ylim

The y-axis min and max limits for the plot

y_breaks

The tick mark values to show for the y axis

Value

A ggplot2::ggplot() object


pacific-hake/hake-assessment documentation built on Nov. 8, 2024, 1:16 p.m.