plot_weights_lengths: Plot some years of weight of length histograms

View source: R/plot-weights-lengths.R

plot_weights_lengthsR Documentation

Plot some years of weight of length histograms

Description

Plot some years of weight of length histograms

Usage

plot_weights_lengths(
  df,
  type = c("length", "weight"),
  include_sex = TRUE,
  min_total = 20,
  bin_width = 0.075,
  x_breaks = pretty(d[[bin_col]], 4L),
  label_font_size = 2.25,
  fill_col = c(F = rgb(1, 0, 0, 0.3), M = rgb(0, 0, 1, 0.3)),
  line_col = c(F = rgb(1, 0, 0, 0.3), M = rgb(0, 0, 1, 0.3)),
  unsexed_fill_col = rgb(0, 0, 1, 0.3),
  unsexed_col = "black",
  unit_str = ifelse(type == "length", "cm", "kg")
)

Arguments

df

A data frame as returned by gfplot::tidy_lengths_raw()

type

Either "length" or "weight"

include_sex

Logical. If TRUE, include the sex data in the plot, with two bar colors

min_total

Minimum number of fish for a given survey and year needed before a histogram is shown.

bin_width

The width of the bars in units of the plot

x_breaks

A vector of values to show on the x-axis as tick labels

label_font_size

The font size for the sample size labels

fill_col

A named vector of two colors for Female and male bars. The names are "F" and "M" respectively.

line_col

A named vector of two colors for Female and male bar outlines. The names are "F" and "M" respectively.

unsexed_fill_col

The color to use for non-sex-specific bar fill

unsexed_col

Thew color to use for the bar border for unsexed bars

unit_str

A string representing the units, e.g. 'g' or 'kg'

Value

A ggplot2::ggplot() object


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