pub struct BoxPlotArtist {
pub stats: Vec<BoxStats>,
pub labels: Vec<String>,
pub color: Color,
pub label: Option<String>,
pub alpha: f64,
pub box_width: f64,
pub show_outliers: bool,
pub whisker_iq_factor: f64,
pub raw_data: Vec<Vec<f64>>,
}Expand description
A box-and-whisker plot showing distribution summaries for one or more groups of data.
Each group produces a box spanning Q1 to Q3 with a median line, whiskers extending to the most extreme data points within the configured fence, and optional outlier dots beyond the whiskers.
Fields§
§stats: Vec<BoxStats>Pre-computed summary statistics for each group.
labels: Vec<String>Category labels for the x-axis (one per group).
color: ColorFill color of the boxes.
label: Option<String>Optional legend label.
alpha: f64Opacity from 0.0 (fully transparent) to 1.0 (fully opaque).
box_width: f64Box width as a fraction of the category spacing.
show_outliers: boolWhether to draw outlier dots.
whisker_iq_factor: f64Whisker extent as a multiple of IQR.
raw_data: Vec<Vec<f64>>Raw data retained for re-computing stats when parameters change.
Implementations§
Source§impl BoxPlotArtist
impl BoxPlotArtist
Sourcepub fn data_bounds(&self) -> (f64, f64, f64, f64)
pub fn data_bounds(&self) -> (f64, f64, f64, f64)
Computes the data-space bounding box (xmin, xmax, ymin, ymax).
The x-axis spans from -0.5 to n - 0.5 (where n is the number
of groups), centering each box on an integer position. The y-axis
spans from the lowest whisker (or outlier) to the highest.
Source§impl BoxPlotArtist
impl BoxPlotArtist
Sourcepub fn color(&mut self, color: Color) -> &mut Self
pub fn color(&mut self, color: Color) -> &mut Self
Sets the box fill color.
Applies the given Color to every box rendered by this artist.
Sourcepub fn label(&mut self, label: &str) -> &mut Self
pub fn label(&mut self, label: &str) -> &mut Self
Sets the legend label.
When a legend is displayed on the figure, this label will appear next to the color swatch for this box plot.
Sourcepub fn alpha(&mut self, alpha: f64) -> &mut Self
pub fn alpha(&mut self, alpha: f64) -> &mut Self
Sets the opacity.
The value is clamped to the range [0.0, 1.0], where 0.0 is fully transparent and 1.0 is fully opaque.
Sourcepub fn width(&mut self, width: f64) -> &mut Self
pub fn width(&mut self, width: f64) -> &mut Self
Sets the box width as a fraction of the category spacing.
Smaller values produce thinner boxes with more whitespace between them. The value is clamped to [0.1, 1.0].
Sourcepub fn show_outliers(&mut self, show: bool) -> &mut Self
pub fn show_outliers(&mut self, show: bool) -> &mut Self
Controls whether outlier points are drawn.
When true (the default), data points beyond the whiskers are rendered
as individual dots. When false, outliers are hidden.
Sourcepub fn whisker_factor(&mut self, factor: f64) -> &mut Self
pub fn whisker_factor(&mut self, factor: f64) -> &mut Self
Sets the whisker extent factor.
Whiskers extend from Q1 and Q3 by this factor multiplied by the interquartile range (IQR). The standard value is 1.5. Changing this value recomputes the box statistics from the stored raw data.
Trait Implementations§
Source§impl Clone for BoxPlotArtist
impl Clone for BoxPlotArtist
Source§fn clone(&self) -> BoxPlotArtist
fn clone(&self) -> BoxPlotArtist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more