GeomFreqpoly
Frequency polygon: continuous x binned like a histogram, drawn as a line through bin centers. Do not map aes.y — the bin stat computes it. Canonicalized by normalize() to a line layer with stat bin.
Defaults
- geom
freqpoly- default stat
bin- default position
identity- params type
LineParams
Alias
normalize() rewrites this geom to line (with this alias's default stat and position). Prefer the canonical geom in
new code.
Svelte component
import { GGPlot, GeomFreqpoly } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x" }}>
<GeomFreqpoly />
</GGPlot> JSON layer
{
"geom": "freqpoly",
"stat": "bin"
} Params
alphanumberLine opacity. Must be between 0 and 1 (inclusive). Default 1.
linewidthnumberStroke width in px. Must be greater than 0. Default 1.5.
curve"linear" | "step" | "step-hv" | "step-vh"Interpolation: "linear" (default), "step" (mid-x corners), "step-hv" (horizontal then vertical — correct for ECDF), or "step-vh".
padbooleanWith stat ecdf: when true (default), prepend (xmin, 0) so step stairs start at zero. Finite-clamped.
nnumberWith stat ecdf: evaluate on n equally spaced x in [min, max] per group; omit for one point per unique x.
connection"hv" | "vh" | "mid" | "linear"STAT CONNECT ONLY: how successive points join — "hv" (default), "vh", "mid", or "linear". Ignored for other stats.
binsnumberSTAT BIN / SUMMARY_BIN: number of bins (integer ≥ 1). Default 30 — an advisory reminds you to pick a real value. Overridden by binwidth.
binwidthnumberSTAT BIN / SUMMARY_BIN: bin width in data units (must be greater than 0). Takes precedence over bins.
boundarynumberSTAT BIN / SUMMARY_BIN: align a bin EDGE with this x value. Mutually exclusive with center.
centernumberSTAT BIN / SUMMARY_BIN: align a bin CENTER with this x value. Mutually exclusive with boundary.
closed"right" | "left"STAT BIN / SUMMARY_BIN: which edge of each bin is inclusive: "right" (default) or "left".
fun"first" | "last" | "mean" | "median" | "min" | "max" | "sum"SUMMARY_BIN center fun (mean/median/sum;) or MANUAL named transform (first|last|mean|median|min|max|sum;). Required when stat is "manual".
funMinSummaryFunSTAT SUMMARY_BIN ONLY: lower bound summary (ymin).
funMaxSummaryFunSTAT SUMMARY_BIN ONLY: upper bound summary (ymax).
strokePaintGradientPaintWithin-mark gradient stroke paint (not a data scale). Requires a solid fallback.
glowGlowSpecBounded within-mark glow treatment (not theme decoration).
Allowed stats
bindefault
Allowed positions
identitydefault