Skip to main content

log_breaks

Function log_breaks 

Source
pub fn log_breaks(dmin: f64, dmax: f64, m: usize, base: f64) -> Vec<f64>
Expand description

Round ticks for a log-transformed axis, matching R’s scales::log_breaks(): prefers base^n; when the range spans too few decades for m ticks, mixes in evenly-spaced sub-multiples of base (e.g. {1,2,5} * 10^n for base 10); falls back to extended_breaks over the data range [dmin, dmax] when neither gives enough ticks. dmin/dmax are in data (pre-transform) space and must be finite and positive.