Table of Contents

Class Heatmap

Namespace
ScottPlot.Plottables
Assembly
ScottPlot.dll
public class Heatmap : IPlottable, IHasColorAxis
Inheritance
Heatmap
Implements
Inherited Members
Extension Methods

Constructors

Heatmap(double[,])

public Heatmap(double[,] intensities)

Parameters

intensities double[,]

Properties

AlphaMap

If present, this array defines transparency for each cell in the heatmap. Values range from 0 (transparent) through 255 (opaque).

public byte[,]? AlphaMap { get; set; }

Property Value

byte[,]

Axes

This object performs coordinate/pixel translation at render time based on the latest data area. It stores the axes to use for this plottable and also the data area (in pixels) updated just before each render. If this object is null it will be constructed using the default X and Y axes at render time.

public IAxes Axes { get; set; }

Property Value

IAxes

CellAlignment

public Alignment CellAlignment { get; set; }

Property Value

Alignment

CellHeight

Height of a single cell from the heatmap (in coordinate units)

public double CellHeight { get; set; }

Property Value

double

CellWidth

Width of a single cell from the heatmap (in coordinate units)

public double CellWidth { get; set; }

Property Value

double

Colormap

public IColormap Colormap { get; set; }

Property Value

IColormap

DataRange

Range of values spanned by the data the last time it was updated

public Range DataRange { get; }

Property Value

Range

Extent

public CoordinateRect? Extent { get; set; }

Property Value

CoordinateRect?

FlipColumns

public bool FlipColumns { get; set; }

Property Value

bool

FlipHorizontally

public bool FlipHorizontally { get; set; }

Property Value

bool

FlipRows

public bool FlipRows { get; set; }

Property Value

bool

FlipVertically

public bool FlipVertically { get; set; }

Property Value

bool

Intensities

Data values for the heatmap. Update() must be called after changing this array or editing its values.

public double[,] Intensities { get; set; }

Property Value

double[,]

IsVisible

Toggles whether this plottable is shown and contributes to the automatic axis limit detection. The calling method will check this variable (it does not need to be checked inside the Render method).

public bool IsVisible { get; set; }

Property Value

bool

LegendItems

Items which will appear in the legend

public IEnumerable<LegendItem> LegendItems { get; }

Property Value

IEnumerable<LegendItem>

ManualRange

If supplied, the colormap will span this range of values

public Range? ManualRange { get; set; }

Property Value

Range?

NaNCellColor

Defines what color will be used to fill cells containing NaN.

public Color NaNCellColor { get; set; }

Property Value

Color

Opacity

Controls the opacity of the entire heatmap from 0 (transparent) to 1 (opaque)

public double Opacity { get; set; }

Property Value

double

Position

If defined, the this rectangle sets the axis boundaries of heatmap data. Note that the actual heatmap area is 1 cell larger than this rectangle.

public CoordinateRect? Position { get; set; }

Property Value

CoordinateRect?

Rectangle

If defined, the heatmap will be rendered within the edges of this rectangle.

public CoordinateRect? Rectangle { set; }

Property Value

CoordinateRect?

Smooth

public bool Smooth { get; set; }

Property Value

bool

Methods

~Heatmap()

protected ~Heatmap()

GetAxisLimits()

Return the 2D area (in coordinate space) occupied by the data contained in this plottable

public AxisLimits GetAxisLimits()

Returns

AxisLimits

GetIndexes(Coordinates)

Return the position in the array beneath the given point

public (int x, int y) GetIndexes(Coordinates coordinates)

Parameters

coordinates Coordinates

Returns

(int x, int y)

GetRange()

public Range GetRange()

Returns

Range

GetValue(Coordinates)

Return the value of the cell beneath the given point. Returns NaN if the point is outside the heatmap area.

public double GetValue(Coordinates coordinates)

Parameters

coordinates Coordinates

Returns

double

Render(RenderPack)

Draw the data from this plottable into the data area defined in the Axes. By default the surface is already clipped to the data area, but this can be cleared inside the plottable.

public virtual void Render(RenderPack rp)

Parameters

rp RenderPack

Update()

Regenerate the image using the present settings and data in Intensities

public void Update()