GeomSmooth
Smooth geometry: a fitted trend line (with an optional confidence ribbon) over an x/y scatter, one fit per group. Use to reveal trends.
Defaults
- geom
smooth- default stat
smooth- default position
identity- params type
SmoothParams
Svelte component
import { GGPlot, GeomSmooth } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<GeomSmooth />
</GGPlot> JSON layer
{
"geom": "smooth",
"stat": "smooth"
} Params
method"lm" | "loess"Smoothing method: "lm" (least-squares line) or "loess" (local polynomial regression). Omit to infer: loess for fewer than 1000 rows, lm above (an advisory reports the choice).
sebooleanDraw the confidence-interval ribbon around the fit. Default true.
levelnumberConfidence level of the ribbon, strictly between 0 and 1. Default 0.95.
spannumberLOESS ONLY: fraction of points in each local neighborhood, greater than 0 and at most 1. Default 0.75. Smaller = wigglier.
degree1 | 2LOESS ONLY: degree of the local polynomial, 1 or 2. Default 2 (the R default).
nnumberNumber of evaluation points along x (an integer between 2 and 5000). Default 80.
linewidthnumberStroke width of the fitted line in px. Must be greater than 0. Default 1.
alphanumberLine opacity. Must be between 0 and 1 (inclusive). Default 1.
strokePaintGradientPaintWithin-mark gradient stroke paint for the fitted line (not a data scale).
glowGlowSpecBounded within-mark glow treatment (not theme decoration).
Allowed stats
smoothdefault
Allowed positions
identitydefault