Skip to main content

lttb

Function lttb 

Source
pub fn lttb(x: &[f64], y: &[f64], count: usize) -> Vec<usize>
Expand description

Thins (x, y) to count samples by largest-triangle-three-buckets.

LTTB keeps the shape a naive stride throws away: each bucket contributes the sample forming the largest triangle with the previously kept sample and the mean of the next bucket, so peaks and inflections survive. The first and last samples are always kept.

Asking for at least as many samples as there are, or for fewer than three, keeps everything.