pretty_labels: Define pretty labels

View source: R/pretty_axis_support.R

pretty_labelsR Documentation

Define pretty labels

Description

This function defines pretty axis labels from an object.

Usage

pretty_labels(
  x,
  at,
  n = NULL,
  pi_notation_args = NULL,
  sci_notation_args = list()
)

Arguments

x

An object, such as a numeric vector.

at

A numeric vector of axis positions.

n

(optional) An integer which defines the number of decimal places for numeric axes. This is passed to add_lagging_point_zero. If NULL, n is defined internally.

pi_notation_args

A named list of arguments passed to pi_notation (excluding x).

sci_notation_args

A named list of arguments passed to sci_notation (excluding x).

Details

For factors, factor levels at positions specified by at are taken as labels. For numbers, add_lagging_point_zero and sci_notation are implemented as necessary to define pretty labels.

Value

A vector of labels, of the same length as axis tick marks (at).

Author(s)

Edward Lavender


edwardlavender/prettyGraphics documentation built on Jan. 19, 2025, 2:47 p.m.