GeomContour

Contour geometry: isolines of a continuous z surface over a regular x×y grid. v1 draws open path polylines only (not filled bands).

Defaults

geom
contour
default stat
contour
default position
identity
params type
ContourParams

Svelte component

import { GGPlot, GeomContour } from "@ggsvelte/svelte";

<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
  <GeomContour />
</GGPlot>

JSON layer

{
  "geom": "contour",
  "stat": "contour"
}

Params

bins

number

Number of evenly spaced contour levels from min(z) to max(z) inclusive (integer ≥ 1). Default 10. Overridden by breaks or binwidth.

binwidth

number

Contour level step in z units (must be greater than 0). Takes precedence over bins; overridden by breaks.

breaks

Array<number>

Explicit contour levels (finite numbers). Overrides bins and binwidth when non-empty.

linewidth

number

Stroke width of contour lines in px. Must be greater than 0. Default 1.

alpha

number

Line opacity. Must be between 0 and 1 (inclusive). Default 1.

Allowed stats

Allowed positions

Examples

← All geoms · Getting started