GeomDensity2d
2D density geometry: bivariate KDE isolines over continuous x and y. Open path contours.
Defaults
- geom
density_2d- default stat
density_2d- default position
identity- params type
Density2dParams
Svelte component
import { GGPlot, GeomDensity2d } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<GeomDensity2d />
</GGPlot> JSON layer
{
"geom": "density_2d",
"stat": "density_2d"
} Params
hnumber | Array<number>Kernel bandwidth: one positive number for both axes, or [hx, hy]. Omit for MASS bandwidth.nrd per axis (then kde2d h/4 scaling).
adjustnumberBandwidth multiplier (must be greater than 0). Default 1.
nnumberGrid resolution per axis for the KDE surface (integer 10–200). Default 100.
binsnumberNumber of contour levels of the density surface (integer ≥ 1). Default 10. Overridden by breaks.
binwidthnumberContour level step in density units. Overridden by breaks.
breaksArray<number>Explicit density contour levels. Overrides bins and binwidth.
linewidthnumberStroke width of density contours in px. Must be greater than 0. Default 1.
alphanumberLine opacity. Must be between 0 and 1 (inclusive). Default 1.
Allowed stats
density_2ddefault
Allowed positions
identitydefault