axis_labels_rs

Crates.ioaxis_labels_rs
lib.rsaxis_labels_rs
version0.3.0
sourcesrc
created_at2024-10-26 13:18:21.695773
updated_at2024-11-02 10:41:53.191288
descriptionOptimally readable axis labels for terminal plots.
homepage
repositoryhttps://github.com/olavolav/axis_labels_rs
max_upload_size
id1423864
size24,156
Olav Stetter (olavolav)

documentation

README

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
Commit count: 46

cargo fmt