[][src]Macro ndhistogram::ndhistogram

macro_rules! ndhistogram {
    ($( $x:expr ),+ $(,)*; $type:ty $(;)*) => { ... };
    ($( $x:expr ),+ $(,)*) => { ... };
}

Creates a Histogram.

This macro is the recommended method for constructing new Histograms. The arguments are a command separated list of Axis. Optionally, the type of the Histogram bin values may specified after a semi-colon after the list of Axis. If the bin value type is not specified, the default is f64.

Example

Creating a 1D Histogram

use ndhistogram::axis::Uniform;
use std::fmt::Display;
use ndhistogram::{ndhistogram, Histogram};

let hist1D = ndhistogram!(Uniform::new(10, -5.0, 5.0));
println!("{}", hist1D);

Creating a 2D Histogram

use ndhistogram::axis::Uniform;
use ndhistogram::{ndhistogram, Histogram};

let hist2D = ndhistogram!(Uniform::new(10, -5.0, 5.0), Uniform::new(10, -5.0, 5.0));
println!("{}", hist2D);