MCPcopy Create free account
hub / github.com/alceal/plotlars / log_range

Function log_range

crates/plotlars-plotters/src/render/axis.rs:60–63  ·  view source on GitHub ↗

Transform a range to log10 space, clamping the lower bound to a positive value.

(min: f64, max: f64)

Source from the content-addressed store, hash-verified

58
59/// Transform a range to log10 space, clamping the lower bound to a positive value.
60pub(super) fn log_range(min: f64, max: f64) -> (f64, f64) {
61 let lo = if min > 0.0 { min } else { max * 1e-6 };
62 (lo.log10(), max.log10())
63}
64
65/// Transform a slice of (x, y) pairs to log10 space on the requested axes,
66/// filtering out non-positive values on log axes.

Callers 1

render_numericFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected