ContourMark<T> Class

Draws the density contours of points: the two-dimensional density of the points, estimated with a Gaussian kernel on a grid, is cut at round thresholds with marching squares, and the region above each threshold is filled (or outlined) with the color of the threshold, mapped by the color scale (a sequential scale by default).

public sealed class ContourMark<T> : Mark<T>

Type parameters

T
The type of the rows.

Remarks

The Mark<T>.Fill channel is not used: the thresholds give the colors.

Inheritance
Mark<T> ContourMark<T>

Constructors

NameDescription
ContourMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>)Initializes a new instance of the ContourMark<T> class.

ContourMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>)

ContourMark.cs

Initializes a new instance of the ContourMark<T> class.

public ContourMark(IEnumerable<T> data, Func<T, object?> x, Func<T, object?> y)

Parameters

data IEnumerable<T>
The rows.
x Func<T, object?>
The channel of the x position.
y Func<T, object?>
The channel of the y position.

Properties

NameDescription
BandwidthXGets or sets the bandwidth of the kernel along x, in the unit of x, or null for Silverman's rule of thumb.
BandwidthYGets or sets the bandwidth of the kernel along y, in the unit of y, or null for Silverman's rule of thumb.
FillOpacityGets or sets the opacity of the fill, from 0 to 1. The default is 1.
FilledGets or sets a value that indicates whether the regions are filled; otherwise their outlines are drawn. The default is true.
GridSizeGets or sets the number of points of the grid of the density along each axis. The default is 64.
ThresholdsGets or sets the approximate number of thresholds: the contours are at round values of the density. The default is 10.
XGets the channel of the x position.
YGets the channel of the y position.

BandwidthX

ContourMark.cs

Gets or sets the bandwidth of the kernel along x, in the unit of x, or null for Silverman's rule of thumb.

public double? BandwidthX { get; set; }

Property value

double?

BandwidthY

ContourMark.cs

Gets or sets the bandwidth of the kernel along y, in the unit of y, or null for Silverman's rule of thumb.

public double? BandwidthY { get; set; }

Property value

double?

FillOpacity

ContourMark.cs

Gets or sets the opacity of the fill, from 0 to 1. The default is 1.

public double FillOpacity { get; set; }

Property value

double

Gets or sets a value that indicates whether the regions are filled; otherwise their outlines are drawn. The default is true.

public bool Filled { get; set; }

Property value

bool

Gets or sets the number of points of the grid of the density along each axis. The default is 64.

public int GridSize { get; set; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 2.

Thresholds

ContourMark.cs

Gets or sets the approximate number of thresholds: the contours are at round values of the density. The default is 10.

public int Thresholds { get; set; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 1.

Gets the channel of the x position.

public Func<T, object?> X { get; }

Property value

Func<T, object?>

Gets the channel of the y position.

public Func<T, object?> Y { get; }

Property value

Func<T, object?>