pub struct HeatmapArtist {
pub data: Vec<Vec<f64>>,
pub x_labels: Option<Vec<String>>,
pub y_labels: Option<Vec<String>>,
pub cmap: Colormap,
pub vmin: Option<f64>,
pub vmax: Option<f64>,
pub show_values: bool,
pub color: Color,
pub label: Option<String>,
pub show_colorbar: bool,
}Expand description
A heatmap showing a 2D grid of values mapped to colors via a colormap.
Each cell in the grid is filled with a color determined by mapping its
value through the configured Colormap. Optional text annotations
can display the numeric value inside each cell.
Fields§
§data: Vec<Vec<f64>>Row-major grid of values. data[row][col].
x_labels: Option<Vec<String>>Optional column labels for the x-axis.
y_labels: Option<Vec<String>>Optional row labels for the y-axis.
cmap: ColormapColormap used to map cell values to colors.
vmin: Option<f64>Minimum value for colormap normalisation. None means auto.
vmax: Option<f64>Maximum value for colormap normalisation. None means auto.
show_values: boolWhether to draw cell values as text.
color: ColorPrimary color (used for legend swatch).
label: Option<String>Optional legend label.
show_colorbar: boolWhether to auto-attach a colorbar when this heatmap is drawn.
Implementations§
Source§impl HeatmapArtist
impl HeatmapArtist
Source§impl HeatmapArtist
impl HeatmapArtist
Sourcepub fn colormap(&mut self, cmap: Colormap) -> &mut Self
pub fn colormap(&mut self, cmap: Colormap) -> &mut Self
Sets the colormap used to map cell values to colors.
Sourcepub fn vmin(&mut self, min: f64) -> &mut Self
pub fn vmin(&mut self, min: f64) -> &mut Self
Sets the minimum value for colormap normalisation.
Sourcepub fn vmax(&mut self, max: f64) -> &mut Self
pub fn vmax(&mut self, max: f64) -> &mut Self
Sets the maximum value for colormap normalisation.
Sourcepub fn show_values(&mut self, show: bool) -> &mut Self
pub fn show_values(&mut self, show: bool) -> &mut Self
Enables or disables drawing cell values as text in each cell.
Sourcepub fn colorbar(&mut self, show: bool) -> &mut Self
pub fn colorbar(&mut self, show: bool) -> &mut Self
Enables or disables auto-attaching a colorbar when this heatmap is drawn.
When true, the parent axes will automatically add a colorbar showing
the color-to-value mapping used by this heatmap.
Sourcepub fn x_labels(&mut self, labels: Vec<String>) -> &mut Self
pub fn x_labels(&mut self, labels: Vec<String>) -> &mut Self
Sets the x-axis labels for the heatmap columns.
Sourcepub fn y_labels(&mut self, labels: Vec<String>) -> &mut Self
pub fn y_labels(&mut self, labels: Vec<String>) -> &mut Self
Sets the y-axis labels for the heatmap rows.
Sourcepub fn effective_vmin(&self) -> f64
pub fn effective_vmin(&self) -> f64
Returns the effective minimum value for colormap normalisation.
Sourcepub fn effective_vmax(&self) -> f64
pub fn effective_vmax(&self) -> f64
Returns the effective maximum value for colormap normalisation.
Trait Implementations§
Source§impl Clone for HeatmapArtist
impl Clone for HeatmapArtist
Source§fn clone(&self) -> HeatmapArtist
fn clone(&self) -> HeatmapArtist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more