pub struct BoxStats {
pub min: f64,
pub q1: f64,
pub median: f64,
pub q3: f64,
pub max: f64,
pub outliers: Vec<f64>,
pub mean: Option<f64>,
pub n: usize,
pub points: Vec<f64>,
}Expand description
Five-number summary plus outliers.
Fields§
§min: f64Lower whisker end.
q1: f64First quartile.
median: f64Median.
q3: f64Third quartile.
max: f64Upper whisker end.
outliers: Vec<f64>Points outside the whiskers.
mean: Option<f64>Arithmetic mean, when known (set by BoxStats::from_samples).
n: usizeNumber of samples behind the statistics (0 = unknown); drives the notch width.
points: Vec<f64>Raw samples (at most 300, evenly thinned) for jittered points.
Implementations§
Source§impl BoxStats
impl BoxStats
Sourcepub fn new(min: f64, q1: f64, median: f64, q3: f64, max: f64) -> Self
pub fn new(min: f64, q1: f64, median: f64, q3: f64, max: f64) -> Self
Precomputed statistics (no outliers).
Sourcepub fn points(self, p: impl IntoIterator<Item = f64>) -> Self
pub fn points(self, p: impl IntoIterator<Item = f64>) -> Self
Raw samples to show as jittered points (non-finite values dropped).
Sourcepub fn outliers(self, o: impl IntoIterator<Item = f64>) -> Self
pub fn outliers(self, o: impl IntoIterator<Item = f64>) -> Self
Add outliers.
Sourcepub fn from_samples(samples: &[f64], k: f64) -> Option<Self>
pub fn from_samples(samples: &[f64], k: f64) -> Option<Self>
Compute from samples with whiskers at k × IQR (non-finite values ignored).
Returns None when there are no finite samples.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BoxStats
impl<'de> Deserialize<'de> for BoxStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for BoxStats
Auto Trait Implementations§
impl Freeze for BoxStats
impl RefUnwindSafe for BoxStats
impl Send for BoxStats
impl Sync for BoxStats
impl Unpin for BoxStats
impl UnsafeUnpin for BoxStats
impl UnwindSafe for BoxStats
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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