Add colourmap to heatmap

This commit is contained in:
silvana 2023-09-28 09:44:29 +02:00
parent 03b356f575
commit fa23f04fae

View file

@ -1,4 +1,7 @@
use sys::{ImPlotHeatmapFlags, ImPlotHeatmapFlags__ImPlotHeatmapFlags_ColMajor};
use sys::{
ImPlotColormap__ImPlotColormap_Viridis, ImPlotHeatmapFlags,
ImPlotHeatmapFlags__ImPlotHeatmapFlags_ColMajor,
};
use crate::sys;
use std::ffi::CString;
@ -24,14 +27,15 @@ impl PlotHeatmap {
}
unsafe {
sys::ImPlot_PushColormap_PlotColormap(ImPlotColormap__ImPlotColormap_Viridis as i32);
sys::ImPlot_PlotHeatmap_doublePtr(
self.label.as_ptr() as *const c_char,
x.as_ptr(),
rows,
cols,
0.0,
0.0,
"\0".as_ptr() as *const c_char,
1.0,
"%.0f\0".as_ptr() as *const c_char,
ImPlotPoint {
x: 0f64,
y: rows as f64,