pub struct HeatMap {
pub traces: Vec<Box<dyn Trace + 'static>>,
pub layout: Layout,
}
Expand description
A structure representing a heat map.
The HeatMap
struct enables the creation of heat map visualizations with options for color scaling,
axis customization, legend adjustments, and data value formatting. Users can customize the color
scale, adjust the color bar, and set titles for the plot and axes, as well as format ticks and scales
for improved data readability.
§Arguments
data
- A reference to theDataFrame
containing the data to be plotted.x
- A string slice specifying the column name for x-axis values.y
- A string slice specifying the column name for y-axis values.z
- A string slice specifying the column name for z-axis values, which are represented by the color intensity.auto_color_scale
- An optional boolean for enabling automatic color scaling based on data.color_bar
- An optional reference to aColorBar
struct for customizing the color bar appearance.color_scale
- An optionalPalette
enum for specifying the color scale (e.g., Viridis).reverse_scale
- An optional boolean to reverse the color scale direction.show_scale
- An optional boolean to display the color scale on the plot.plot_title
- An optionalText
struct for setting the title of the plot.x_title
- An optionalText
struct for labeling the x-axis.y_title
- An optionalText
struct for labeling the y-axis.x_axis
- An optional reference to anAxis
struct for customizing x-axis appearance.y_axis
- An optional reference to anAxis
struct for customizing y-axis appearance.
§Example
use plotlars::{ColorBar, HeatMap, Palette, Plot, Text, ValueExponent};
let dataset = LazyCsvReader::new("data/heatmap.csv")
.finish()
.unwrap()
.collect()
.unwrap();
HeatMap::builder()
.data(&dataset)
.x("x")
.y("y")
.z("z")
.color_bar(
&ColorBar::new()
.length(290)
.value_exponent(ValueExponent::None)
.separate_thousands(true)
.tick_length(5)
.tick_step(2500.0)
)
.plot_title(
Text::from("Heat Map")
.font("Arial")
.size(18)
)
.color_scale(Palette::Viridis)
.build()
.plot();
Fields§
§traces: Vec<Box<dyn Trace + 'static>>
§layout: Layout
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HeatMap
impl !RefUnwindSafe for HeatMap
impl !Send for HeatMap
impl !Sync for HeatMap
impl Unpin for HeatMap
impl !UnwindSafe for HeatMap
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more