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.
extended_range_breaks_(
dmin,
dmax,
n = 5,
Q = c(1, 5, 2, 2.5, 4, 3),
w = c(0.25, 0.2, 0.5, 0.05)
)extended_range_breaks(n = 5, ...)
For extended_range_breaks
, the vector of axis label locations.
For scales_extended_range_breaks
, a function which takes a single argument, a vector of data, and returns the vector of axis label locations.
A function which returns breaks given a vector.
minimum of the data range
maximum of the data range
desired number of breaks
set of nice numbers
weights applied to the four optimization components (simplicity, coverage, density, and legibility)
other arguments passed to extended_range_breaks_()
Justin Talbot jtalbot@stanford.edu, Jeffrey B. Arnold, Baptiste Auguie
extended_range_breaks
implements the algorithm and returns the break values.
scales_extended_range_breaks
uses the conventions of the scales package, and returns a function.
Talbot, J., Lin, S., Hanrahan, P. (2010) An Extension of Wilkinson's Algorithm for Positioning Tick Labels on Axes, InfoVis 2010.