pub struct HistogramBins {
pub edges: Vec<f64>,
pub counts: Vec<usize>,
pub densities: Vec<f64>,
}Expand description
Histogram binning configuration.
Fields§
§edges: Vec<f64>Bin edges (n+1 edges for n bins)
counts: Vec<usize>Bin counts
densities: Vec<f64>Bin densities (normalized)
Implementations§
Source§impl HistogramBins
impl HistogramBins
Sourcepub fn from_data(data: &[f64], num_bins: usize) -> HistogramBins
pub fn from_data(data: &[f64], num_bins: usize) -> HistogramBins
Create histogram from data with specified number of bins.
Sourcepub fn from_data_range(
data: &[f64],
num_bins: usize,
min: f64,
max: f64,
) -> HistogramBins
pub fn from_data_range( data: &[f64], num_bins: usize, min: f64, max: f64, ) -> HistogramBins
Create histogram from data with explicit range.
Sourcepub fn bin_center(&self, index: usize) -> Option<f64>
pub fn bin_center(&self, index: usize) -> Option<f64>
Get bin center for given index.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total count across all bins.
Trait Implementations§
Source§impl Clone for HistogramBins
impl Clone for HistogramBins
Source§fn clone(&self) -> HistogramBins
fn clone(&self) -> HistogramBins
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HistogramBins
impl RefUnwindSafe for HistogramBins
impl Send for HistogramBins
impl Sync for HistogramBins
impl Unpin for HistogramBins
impl UnwindSafe for HistogramBins
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more