range_breaks: Pretty axis breaks inclusive of extreme values

Description Usage Arguments Value Author(s) References

View source: R/range_breaks.R

Description

This function returns pretty axis breaks that always include the extreme values of the data. This works by calling the extended Wilkinson algorithm (Talbot et. al, 2010), constrained to solutions interior to the data range. Then, the minimum and maximum labels are moved to the minimum and maximum of the data range.

Usage

1
2
range_breaks(x, n = 5, Q = c(1, 5, 2, 2.5, 4, 3), w = c(0.25, 0.2, 0.5,
  0.05))

Arguments

x

Vector of numeric values

n

desired number of breaks

Q

set of nice numbers

w

weights applied to the four optimization components (simplicity, coverage, density, and legibility)

Value

For range_breaks, a function which takes a single argument, a vector of data, which returns the vector of axis label locations.

Author(s)

Justin Talbot, Jeffrey B. Arnold, Baptiste Auguie

References

Talbot, J., Lin, S., Hanrahan, P. (2010) An Extension of Wilkinson's Algorithm for Positioning Tick Labels on Axes, InfoVis 2010.


jrnold/ggtufte documentation built on May 4, 2019, 1:21 p.m.