public Heatmap PlotHeatmap( double?[,] intensities, Drawing.Colormap colormap = null, string label = null, double[] axisOffsets = null, double[] axisMultipliers = null, double?scaleMin = null, double?scaleMax = null, double?transparencyThreshold = null, Bitmap backgroundImage = null, bool displayImageAbove = false, bool drawAxisLabels = true ) { Heatmap heatmap = new Heatmap() { Label = label, AxisOffsets = axisOffsets ?? new double[] { 0, 0 }, AxisMultipliers = axisMultipliers ?? new double[] { 1, 1 }, TransparencyThreshold = transparencyThreshold, BackgroundImage = backgroundImage, DisplayImageAbove = displayImageAbove, ShowAxisLabels = drawAxisLabels, }; heatmap.Update(intensities, colormap ?? Drawing.Colormap.Viridis, scaleMin, scaleMax); Add(heatmap); Layout(top: 180); return(heatmap); }
/// <summary> /// Add a heatmap to the plot /// </summary> public Heatmap AddHeatmap(double[,] intensities, Drawing.Colormap colormap = null, bool lockScales = true) { if (lockScales) { AxisScaleLock(true); } var plottable = new Heatmap(); plottable.Update(intensities, colormap); Add(plottable); return(plottable); }
/// <summary> /// Add a heatmap to the plot automatically-sized so each cell is 1x1. /// </summary> /// <param name="intensities">2D array of intensities. /// WARNING: Rendering artifacts may appear for arrays larger than Bitmap can support (~10M total values).</param> /// <param name="colormap"></param> /// <param name="lockScales">If true, AxisScaleLock() will be called to ensure heatmap cells will be square.</param> /// <returns> /// Returns the heatmap that was added to the plot. /// Act on its public fields and methods to customize it or update its data. /// </returns> public Heatmap AddHeatmap(double[,] intensities, Drawing.Colormap colormap = null, bool?lockScales = null) { var plottable = new Heatmap(); plottable.Update(intensities, colormap); Add(plottable); if (lockScales.HasValue && lockScales.Value == true) { AxisScaleLock(true); } if (lockScales is null && plottable.IsDefaultSizeAndLocation) { AxisScaleLock(true); } return(plottable); }