add_major_ticks: Create a vector of labels to use when major and minor tick...

View source: R/utils-add-major-ticks.R

add_major_ticksR Documentation

Create a vector of labels to use when major and minor tick marks are to be used in a plot, and the custom tick data frame to be used to draw the lines outside the ggplot panel area using ggplot2::geom_linerange()

Description

Create a vector of labels to use when major and minor tick marks are to be used in a plot, and the custom tick data frame to be used to draw the lines outside the ggplot panel area using ggplot2::geom_linerange()

Usage

add_major_ticks(
  g,
  x_breaks = NULL,
  modulo = 5,
  prop = 0.8,
  major_tick_thickness = 0.5,
  ...
)

Arguments

g

A ggplot2::ggplot() object

x_breaks

A vector of values which are where all the x-axis ticks are located on the plot g. If NULL, this will become a sequence from the lower limit of the x-axis to the upper limit, by 1.

modulo

The number to use as a modulus so that every n-th tick mark is a major tick

prop

A value between 0 and 1 to multiply the length of the major tick lines by. This is used in case the full length ticks are overlapping the tick labels

major_tick_thickness

The thickness of the major tick marks

...

Absorbs arguments meant for other functions

Value

A ggplot2::ggplot() object, the original plot g with x-axis ticks modified to be minor and major ticks


pacific-hake/hake-assessment documentation built on July 21, 2024, 8:19 a.m.