limit_breaks: Truncate log-scaled axis breaks to data range

View source: R/ratioScales.R

limit_breaksR Documentation

Truncate log-scaled axis breaks to data range

Description

Truncate log-scaled axis breaks to data range

Usage

limit_breaks(v, n = 5, splits = 1, base = exp(1))

Arguments

v

Numeric vector, data or data range

n

Scalar, target number of breaks

splits

Integer, one of c(1,2,3). How many tick marks per "decade?"

base

a positive or complex number: the base with respect to which logarithms are computed. Defaults to e=exp(1).

Value

Vector of numeric values for axis breaks

See Also

Other breaking: breaks_divMult(), limitimil(), split_decades()

Examples

dat <- exp(seq(-2,5,0.2))
v <- log(dat) # data or data range
n <- 5
# axisTicks returns values way beyond data
grDevices::axisTicks(nint = n, log = TRUE, usr = range(v))
# limit_breaks reels this in
limit_breaks(v = v, n = n)

mikeroswell/ratioScales documentation built on July 18, 2024, 6:36 p.m.