ViolinMark<T> Class

Draws a violin plot per category of x: the probability density of the y values, mirrored on both sides of the middle of the band, from the smallest value to the largest. A thin box from the first to the third quartile and a dot at the median are drawn inside, unless ViolinMark<T>.ShowBox is off. The widths of the violins are proportional to their densities: the widest point of all the violins fills ViolinMark<T>.ViolinWidth of the band.

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

Type parameters

T
The type of the rows.
Inheritance
Mark<T> ViolinMark<T>

Constructors

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

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

ViolinMark.cs

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

public ViolinMark(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 category.
y Func<T, object?>
The channel of the value.

Properties

NameDescription
BandwidthGets or sets the bandwidth of the kernel, in the unit of y, or null for Silverman's rule of thumb, per category.
SamplesGets or sets the number of points of each side of a violin. The default is 64.
ShowBoxGets or sets a value that indicates whether the quartiles and the median are drawn inside the violins. The default is true.
ViolinWidthGets or sets the width of the widest violin, as a fraction of the band. The default is 0.9.
XGets the channel of the category.
YGets the channel of the value.

Bandwidth

ViolinMark.cs

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

public double? Bandwidth { get; set; }

Property value

double?

Gets or sets the number of points of each side of a violin. The default is 64.

public int Samples { get; set; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is less than 2.

Gets or sets a value that indicates whether the quartiles and the median are drawn inside the violins. The default is true.

public bool ShowBox { get; set; }

Property value

bool

ViolinWidth

ViolinMark.cs

Gets or sets the width of the widest violin, as a fraction of the band. The default is 0.9.

public double ViolinWidth { get; set; }

Property value

double

Gets the channel of the category.

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

Property value

Func<T, object?>

Gets the channel of the value.

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

Property value

Func<T, object?>