#plot #cli #charts

bin+lib axis_labels_rs

Optimally readable axis labels for terminal plots

4 releases (breaking)

0.4.0 Jan 4, 2025
0.3.0 Nov 2, 2024
0.2.0 Oct 26, 2024
0.1.0 Oct 26, 2024

#132 in Visualization

Download history 199/week @ 2024-10-23 166/week @ 2024-10-30 36/week @ 2024-11-06 1/week @ 2024-11-13 2/week @ 2024-11-20 1/week @ 2024-12-04 4/week @ 2024-12-11 133/week @ 2025-01-01 7/week @ 2025-01-08

140 downloads per month

MIT license

24KB
506 lines

axis_labels_rs

crates.io

This is a library to compute optimally readable axis labels for terminal plots. The code is based on the axis_labels code of the Python plotting library uniplot.

It is implemented in Rust for performance reasons, since finding optimal axis labels is done by testing & scoring a large number of possible labels.

Example

use axis_labels_rs::float_axis_labels;

let labels = float_axis_labels(0.0, 123.4, 60, 1, false, &String::from(" m"));
println!("{}", labels);

yields

0 m                    50 m                    100 m

No runtime deps