pub fn plot(&self, values: &[f64], number_of_rows: u32, number_of_cols: u32) {
        // If no range was given, determine that range
        let scale_range = self.scale_range.unwrap_or_else(|| {
            let mut min_seen = values[0];
            let mut max_seen = values[0];
            values.iter().for_each(|value| {
                min_seen = min_seen.min(*value);
                max_seen = max_seen.max(*value);
            });
            (min_seen, max_seen)
        });

        unsafe {
            sys::ImPlot_PlotHeatmapdoublePtr(
                self.label.as_ptr() as *const c_char,
                values.as_ptr(),
                number_of_rows as i32, // Not sure why C++ code uses a signed value here
                number_of_cols as i32, // Not sure why C++ code uses a signed value here
                scale_range.0,
                scale_range.1,
                // "no label" is taken as null pointer in the C++ code, but we're using
                // option types in the Rust bindings because they are more idiomatic.
                if self.label_format.is_some() {
                    self.label_format.as_ref().unwrap().as_ptr() as *const c_char
                } else {
                    std::ptr::null()
                },
                self.drawarea_lower_left,
                self.drawarea_upper_right,
            );
        }
    }
/// Plot the heatmap, with the given values (assumed to be in row-major order),
/// number of rows and number of columns.
Plot the heatmap, with the given values (assumed to be in row-major order),
number of rows and number of columns.
Plot the heatmap with the given values ( assumed to be in row - major order ) number of rows and number of columns .
pub fn plot(&self, values: &[f64], number_of_rows: u32, number_of_cols: u32) {
        // If no range was given, determine that range
        let scale_range = self.scale_range.unwrap_or_else(|| {
            let mut min_seen = values[0];
            let mut max_seen = values[0];
            values.iter().for_each(|value| {
                min_seen = min_seen.min(*value);
                max_seen = max_seen.max(*value);
            });
            (min_seen, max_seen)
        });
        unsafe {
            sys::ImPlot_PlotHeatmapdoublePtr(
                self.label.as_ptr() as *const c_char,
                values.as_ptr(),
                number_of_rows as i32, // Not sure why C++ code uses a signed value here
                number_of_cols as i32, // Not sure why C++ code uses a signed value here
                scale_range.0,
                scale_range.1,
                // "no label" is taken as null pointer in the C++ code, but we're using
                // option types in the Rust bindings because they are more idiomatic.
                if self.label_format.is_some() {
                    self.label_format.as_ref().unwrap().as_ptr() as *const c_char
                } else {
                    std::ptr::null()
                },
                self.drawarea_lower_left,
                self.drawarea_upper_right,
            );
        }
    }
pub fn plot ( & self , values : & [ f64 ] , number_of_rows : u32 , number_of_cols : u32 ) { // If no range was given, determine that range let scale_range = self . scale_range . unwrap_or_else ( | | { let mut min_seen = values [ 0 ] ; let mut max_seen = values [ 0 ] ; values . iter ( ) . for_each ( | value | { min_seen = min_seen . min ( * value ) ; max_seen = max_seen . max ( * value ) ; } ) ; ( min_seen , max_seen ) } ) ; unsafe { sys :: ImPlot_PlotHeatmapdoublePtr ( self . label . as_ptr ( ) as * const c_char , values . as_ptr ( ) , number_of_rows as i32 , // Not sure why C++ code uses a signed value here number_of_cols as i32 , // Not sure why C++ code uses a signed value here scale_range . 0 , scale_range . 1 , // "no label" is taken as null pointer in the C++ code, but we're using // option types in the Rust bindings because they are more idiomatic. if self . label_format . is_some ( ) { self . label_format . as_ref ( ) . unwrap ( ) . as_ptr ( ) as * const c_char } else { std :: ptr :: null ( ) } , self . drawarea_lower_left , self . drawarea_upper_right , ) ; } }
Plot the heatmap, with the given values (assumed to be in row-major order),
number of rows and number of columns.
Plot the heatmap with the given values ( assumed to be in row - major order ) number of rows and number of columns .
&self
values
&[f64]
number_of_rows
u32
number_of_cols
u32
&self
values
&[f64]
number_of_rows
u32
number_of_cols
u32