Heatmaps
The following imports have been used to produce the plots below:
#![allow(unused)] fn main() { use plotly::common::{ColorScale, ColorScalePalette, Title}; use plotly::contour::Contours; use plotly::{Contour, HeatMap, Layout, Plot}; use std::f64::consts::PI; }
The to_inline_html
method is used to produce the html plot displayed in this page.
Basic Heatmap
#![allow(unused)] fn main() { fn basic_heat_map(show: bool) -> Plot { let z = vec![vec![1, 20, 30], vec![20, 1, 60], vec![30, 60, 1]]; let trace = HeatMap::new_z(z).zmin(1.0).zmax(60.0); let mut plot = Plot::new(); plot.add_trace(trace); if show { plot.show(); } plot } }