heatmap/
heatmap.rs

1use polars::prelude::*;
2
3use plotlars::{ColorBar, HeatMap, Palette, Plot, Text, ValueExponent};
4
5fn main() {
6    let dataset = LazyCsvReader::new(PlPath::new("data/heatmap.csv"))
7        .finish()
8        .unwrap()
9        .collect()
10        .unwrap();
11
12    HeatMap::builder()
13        .data(&dataset)
14        .x("x")
15        .y("y")
16        .z("z")
17        .color_bar(
18            &ColorBar::new()
19                .length(290)
20                .value_exponent(ValueExponent::None)
21                .separate_thousands(true)
22                .tick_length(5)
23                .tick_step(2500.0),
24        )
25        .plot_title(Text::from("Heat Map").font("Arial").size(18))
26        .color_scale(Palette::Viridis)
27        .build()
28        .plot();
29}