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