hist

Crates.iohist
lib.rshist
version0.1.0
sourcesrc
created_at2017-11-06 15:08:23.883441
updated_at2017-11-06 15:08:23.883441
descriptionA tiny library to print histograms in Rust.
homepage
repositoryhttps://github.com/DimChtz/rust-hist
max_upload_size
id38355
size5,051
(DimChtz)

documentation

README

rust-hist (hist) - v0.1.0

A tiny library to print histograms in Rust.

Examples

Print a histogram.

let mut h = hist::Hist::new(30, 5, &vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10], &vec![21, 10, 15, 17, 26, 8, 12, 2, 5, 7]);

h.display();

or just:

hist::Hist::new(30, 5, &vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10], &vec![21, 10, 15, 17, 26, 8, 12, 2, 5, 7]).display();
Result
              *
*         *   *
*      *  *   *     *
*   *  *  *   *  *  *         *
*   *  *  *   *  *  *      *  *
*******************************

Installation

Add this line to your Cargo.toml:

[dependencies]
hist = "0.1.0"

and then add this line to your main.rs:

extern crate hist;
Commit count: 9

cargo fmt