pub struct HexbinArtist {
pub x: Vec<f64>,
pub y: Vec<f64>,
pub gridsize: usize,
pub cmap: Colormap,
pub mincnt: usize,
pub alpha: f64,
pub color: Color,
pub label: Option<String>,
pub edgecolor: Option<Color>,
pub show_colorbar: bool,
}Expand description
A hexagonal binning (hexbin) plot that visualises point density on a 2D plane using a grid of flat-top hexagons.
Each hexagon is coloured according to the number of data points that fall
within its boundaries, mapped through the configured Colormap. This
is especially useful for large datasets where individual scatter points
would overlap heavily.
Fields§
§x: Vec<f64>X-coordinates of the raw data points.
y: Vec<f64>Y-coordinates of the raw data points.
gridsize: usizeNumber of hexagons across the x-axis. Default 20.
cmap: ColormapColormap used to map bin counts to colors.
mincnt: usizeMinimum point count for a hex to be drawn. Default 1.
alpha: f64Opacity from 0.0 (fully transparent) to 1.0 (fully opaque).
color: ColorPrimary color (used for legend swatch).
label: Option<String>Optional legend label.
edgecolor: Option<Color>Optional edge (stroke) color for hexagons.
show_colorbar: boolWhether to auto-attach a colorbar when this hexbin is drawn.
Implementations§
Source§impl HexbinArtist
impl HexbinArtist
Source§impl HexbinArtist
impl HexbinArtist
Sourcepub fn gridsize(&mut self, gridsize: usize) -> &mut Self
pub fn gridsize(&mut self, gridsize: usize) -> &mut Self
Sets the number of hexagons across the x-axis.
Sourcepub fn colormap(&mut self, cmap: Colormap) -> &mut Self
pub fn colormap(&mut self, cmap: Colormap) -> &mut Self
Sets the colormap used to map bin counts to colors.
Sourcepub fn mincnt(&mut self, mincnt: usize) -> &mut Self
pub fn mincnt(&mut self, mincnt: usize) -> &mut Self
Sets the minimum count threshold; bins with fewer points are hidden.
Trait Implementations§
Source§impl Clone for HexbinArtist
impl Clone for HexbinArtist
Source§fn clone(&self) -> HexbinArtist
fn clone(&self) -> HexbinArtist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more