pub struct ViolinPlot<C> { /* private fields */ }Expand description
A single violin at one coordinate on the category axis.
Like BoxPlot, it is generic over the full chart coordinate C: a
vertical violin lives on a (X, f64) chart, a horizontal one on (f64, Y).
The half-width scales with the kernel density, so the widest part of the
violin corresponds to the mode of the sample.
Implementations§
Source§impl<X: Clone> ViolinPlot<(X, f64)>
impl<X: Clone> ViolinPlot<(X, f64)>
Sourcepub fn vertical(x: X, data: &[f64]) -> Result<Self, StatsError>
pub fn vertical(x: X, data: &[f64]) -> Result<Self, StatsError>
A vertical violin at category position x from a raw data sample,
using a Silverman-rule bandwidth. Errors if the sample is empty or
degenerate (see crate::stats::kde).
Sourcepub fn vertical_with_bandwidth(
x: X,
data: &[f64],
bandwidth: Option<f64>,
) -> Result<Self, StatsError>
pub fn vertical_with_bandwidth( x: X, data: &[f64], bandwidth: Option<f64>, ) -> Result<Self, StatsError>
A vertical violin with an explicit KDE bandwidth override.
Source§impl<Y: Clone> ViolinPlot<(f64, Y)>
impl<Y: Clone> ViolinPlot<(f64, Y)>
Sourcepub fn horizontal(y: Y, data: &[f64]) -> Result<Self, StatsError>
pub fn horizontal(y: Y, data: &[f64]) -> Result<Self, StatsError>
A horizontal violin at category position y from a raw data sample.
Sourcepub fn horizontal_with_bandwidth(
y: Y,
data: &[f64],
bandwidth: Option<f64>,
) -> Result<Self, StatsError>
pub fn horizontal_with_bandwidth( y: Y, data: &[f64], bandwidth: Option<f64>, ) -> Result<Self, StatsError>
A horizontal violin with an explicit KDE bandwidth override.
Source§impl<C> ViolinPlot<C>
impl<C> ViolinPlot<C>
Sourcepub fn style(self, style: ViolinStyle) -> Self
pub fn style(self, style: ViolinStyle) -> Self
Replace the violin style block.
Trait Implementations§
Source§impl<C: Clone> Clone for ViolinPlot<C>
impl<C: Clone> Clone for ViolinPlot<C>
Source§fn clone(&self) -> ViolinPlot<C>
fn clone(&self) -> ViolinPlot<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: Debug> Debug for ViolinPlot<C>
impl<C: Debug> Debug for ViolinPlot<C>
Source§impl<C, DB: DrawingBackend> Drawable<DB> for ViolinPlot<C>
impl<C, DB: DrawingBackend> Drawable<DB> for ViolinPlot<C>
Auto Trait Implementations§
impl<C> Freeze for ViolinPlot<C>
impl<C> RefUnwindSafe for ViolinPlot<C>where
C: RefUnwindSafe,
impl<C> Send for ViolinPlot<C>where
C: Send,
impl<C> Sync for ViolinPlot<C>where
C: Sync,
impl<C> Unpin for ViolinPlot<C>where
C: Unpin,
impl<C> UnsafeUnpin for ViolinPlot<C>
impl<C> UnwindSafe for ViolinPlot<C>where
C: UnwindSafe,
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<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
impl<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
Source§fn into_dyn(self) -> DynElement<'b, DB, Coord>
fn into_dyn(self) -> DynElement<'b, DB, Coord>
Make the conversion