pub struct CorrelationHeatmap { /* private fields */ }Expand description
A correlation heatmap: a square, labeled, color-mapped grid of a correlation matrix, with an optional colorbar and per-cell value annotations.
Defaults suit correlations: a diverging RdBu colormap on a symmetric
[-1, 1] normalization (0 → white).
Implementations§
Source§impl CorrelationHeatmap
impl CorrelationHeatmap
Sourcepub fn from_columns(
columns: &[Vec<f64>],
labels: Vec<String>,
method: CorrelationMethod,
) -> Result<Self, StatsError>
pub fn from_columns( columns: &[Vec<f64>], labels: Vec<String>, method: CorrelationMethod, ) -> Result<Self, StatsError>
Compute the correlation matrix of columns (one slice per variable, all
the same length) and build a heatmap. labels names the variables.
§Errors
StatsError::LengthMismatchiflabelsandcolumnsdiffer in count.- plus any error from
correlation_matrix.
Sourcepub fn from_matrix(matrix: Vec<Vec<f64>>, labels: Vec<String>) -> Self
pub fn from_matrix(matrix: Vec<Vec<f64>>, labels: Vec<String>) -> Self
Build directly from a precomputed square matrix and its labels.
Sourcepub fn colormap(self, colormap: GradientColorMap) -> Self
pub fn colormap(self, colormap: GradientColorMap) -> Self
Set the color map.
Sourcepub fn normalization(self, norm: Normalization) -> Self
pub fn normalization(self, norm: Normalization) -> Self
Set the value→color normalization.
Sourcepub fn draw<DB: DrawingBackend>(
&self,
area: &DrawingArea<DB, Shift>,
) -> Result<(), Box<dyn Error>>where
DB::ErrorType: 'static,
pub fn draw<DB: DrawingBackend>(
&self,
area: &DrawingArea<DB, Shift>,
) -> Result<(), Box<dyn Error>>where
DB::ErrorType: 'static,
Render the heatmap onto area.
Trait Implementations§
Source§impl Clone for CorrelationHeatmap
impl Clone for CorrelationHeatmap
Source§fn clone(&self) -> CorrelationHeatmap
fn clone(&self) -> CorrelationHeatmap
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 moreAuto Trait Implementations§
impl Freeze for CorrelationHeatmap
impl RefUnwindSafe for CorrelationHeatmap
impl Send for CorrelationHeatmap
impl Sync for CorrelationHeatmap
impl Unpin for CorrelationHeatmap
impl UnsafeUnpin for CorrelationHeatmap
impl UnwindSafe for CorrelationHeatmap
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