RidgelineMark<T> Class

Draws a ridgeline plot (a joy plot): the probability density of the x values of each category of y, estimated with a Gaussian kernel, as an area that rises from the position of the category. The areas overlap the categories above them: the tallest one is RidgelineMark<T>.Overlap times the space between two categories, and the others are scaled with it, so their heights compare. The categories are drawn from the top down, each one in front of the previous one.

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

Type parameters

T
The type of the rows.

Remarks

Unless the plot sets its y scale, the y scale is a point scale that leaves room for the tallest area above the first category.

Inheritance
Mark<T> RidgelineMark<T>

Constructors

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

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

RidgelineMark.cs

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

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

Parameters

data IEnumerable<T>
The rows: the values of all the categories.
x Func<T, object?>
The channel of the value.
y Func<T, object?>
The channel of the category.

Properties

NameDescription
BandwidthGets or sets the bandwidth of the kernel, in the unit of x, or null for Silverman's rule of thumb, per category.
CurveGets or sets how the points of the curves are joined. The default is Curve.MonotoneX.
CutGets or sets how far the curves go beyond the smallest and the largest values of their category, in bandwidths. The default is 3, where the density is almost zero.
FillOpacityGets or sets the opacity of the fill, from 0 to 1. The default is 1.
OverlapGets or sets the height of the tallest area, as a multiple of the space between two categories. The default is 1.5.
SamplesGets or sets the number of points of each curve. The default is 100.
XGets the channel of the value.
YGets the channel of the category.

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

public double? Bandwidth { get; set; }

Property value

double?

Gets or sets how the points of the curves are joined. The default is Curve.MonotoneX.

public Curve Curve { get; set; }

Property value

Curve

Gets or sets how far the curves go beyond the smallest and the largest values of their category, in bandwidths. The default is 3, where the density is almost zero.

public double Cut { get; set; }

Property value

double

FillOpacity

RidgelineMark.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 the height of the tallest area, as a multiple of the space between two categories. The default is 1.5.

public double Overlap { get; set; }

Property value

double

Exceptions

ArgumentOutOfRangeException
The value is not a positive finite number.

Gets or sets the number of points of each curve. The default is 100.

public int Samples { get; set; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 2.

Gets the channel of the value.

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

Property value

Func<T, object?>

Gets the channel of the category.

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

Property value

Func<T, object?>