plot_bubbles: Make a bubble plot from the given data

View source: R/plot-bubbles.R

plot_bubblesR Documentation

Make a bubble plot from the given data

Description

Make a bubble plot from the given data

Usage

plot_bubbles(
  d,
  clines = age_bubble_cohorts,
  val_col_nm = "Proportion",
  tick_prop = 1,
  vjust_x_labels = -1.5,
  remove_yr_labels = NULL,
  mean_age = NULL,
  mean_age_line_color = "red",
  mean_age_line_width = 1.5,
  mean_age_line_type = "solid",
  diag_line_color = age_diag_line_color,
  diag_line_width = age_diag_line_width,
  diag_line_type = age_diag_line_type,
  yrs = NULL,
  x_labs_mod = 5,
  leg_pos = "none",
  point_alpha = main_alpha,
  point_fill = main_fill,
  point_color = "black",
  xlim = c(1966, year(Sys.Date())),
  show_x_axis_labels = TRUE,
  ...
)

Arguments

d

a tibble::tibble() of the data in long format with column names Year, Age, and the column name given by val_col_nm

clines

An optional vector of years to draw cohort lines through

val_col_nm

The name of the column in d to use for the values

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

mean_age

A two-column tibble with column names Year and Age where each row contains a year and Age represents the mean age for each year

mean_age_line_color

The line color for the mean age line

mean_age_line_width

The line width for the mean age line

mean_age_line_type

The line type for the mean age line

diag_line_color

The line color for the cohort diagonal lines

diag_line_width

The line width for the cohort diagonal lines

diag_line_type

The line type for the cohort diagonal lines

yrs

A vector of 2, for the years to show on the plot

x_labs_mod

How many years between year labels on the x-axis

leg_pos

See the legend.position parameter in ggplot2::theme()

point_alpha

Transparency of the bubble fill

point_fill

Color of the bubble fill

point_color

Color of the bubble outline

xlim

Limits for the x-axis

show_x_axis_labels

Logical. If TRUE, show the x-axis title and tick labels

Value

A ggplot2::ggplot() object


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