Skip to main content

Module violin

Module violin 

Source
Expand description

Violin plot — a mirrored kernel-density silhouette per group. The KDE (kde) is a pure function (Gaussian kernel, Silverman bandwidth) sampled on an evenly-spaced grid; ViolinView paints the mirrored density as a filled polygon and overlays the median line.

Structs§

Density
One density curve: grid[i] (the value axis) carries density dens[i].
ViolinView
A violin plot: named groups of raw samples.

Functions§

kde
Gaussian-kernel density estimate of values, evaluated on bins evenly spaced points spanning [min, max] padded by one bandwidth. None for an empty sample.
silverman_bandwidth
Silverman’s rule-of-thumb bandwidth: 1.06 · σ · n^(−1/5). Falls back to a small positive width on a degenerate (zero-variance) sample so the kernel stays well-defined.