#histogram #random #quick #terminal #format #fix #hist

bin+lib v_hist

A really quick way to make histograms that fix the terminal

4 releases

Uses old Rust 2015

0.1.3 Nov 12, 2021
0.1.2 Dec 23, 2019
0.1.1 May 13, 2019
0.1.0 Mar 27, 2019

#24 in #histogram

Download history 11/week @ 2024-02-22 18/week @ 2024-02-29 10/week @ 2024-03-07 13/week @ 2024-03-14 4/week @ 2024-03-21

52 downloads per month

MIT license

5KB
89 lines

hist

Terminal histograms


extern crate v_hist;
extern crate rand;

use rand::Rng;

fn main() {
    let mut h = v_hist::init();
    let mut rng = rand::thread_rng();

    // h.max_width = 50;

    for x in 0..200 {
        h.add_entry(format!("{}", x), rng.gen_range(0, 3000)) ;
    }

    h.draw();
}

and Voila

screenshot


Credit where credit is due: https://github.com/JustinMMiller/CUtils

Dependencies

~0.4–9MB
~56K SLoC