Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Scatter Ternary — Three-Component Composition Plot

Signature

sp.scatterternary(title, x_values, y_values, z_values, *, variant="basic", x_label="A", y_label="B", z_label="C", **kwargs) -> Chart

Aliases: sp.scatterternary, sp.scatter_ternary, sp.ternary, sp.ternary_plot, sp.ternary_scatter, sp.build_scatter_ternary

Description

sp.scatterternary() plots three-component compositions (e.g. soil sand/silt/clay, alloy element fractions, poll shares) inside an equilateral triangle — the standard chart whenever three parts sum to a whole. Each point's three values are barycentric weights normalized internally (a+b+c need not equal 1 or 100, only their ratio matters), converted to Cartesian coordinates and rendered with a full gridline mesh (three families of lines at 20/40/60/80%, one parallel to each triangle side). Reuses the exact same x_values/y_values/z_values and x_label/y_label/z_label inputs already used by 3D scatter charts — no new parameter shape introduced.

Variants

Data

x_values (list[float]) — First component (A, top vertex). y_values (list[float]) — Second component (B, right vertex). z_values (list[float]) — Third component (C, left vertex). x_label (str) — Label for the top vertex. y_label (str) — Label for the right vertex. z_label (str) — Label for the left vertex. color_values (list[float]) — Continuous values for the "gradient" variant.

Parameters

Themes

Returns

Chart — object with .html property and .show() method.

Single palette color, semi-transparent markers.

Variant "basic"Aliases basic / default / classic / dots
Preview

Point radius scales with `color_values` (4.5× range between smallest and largest) instead of a fixed `point_size` — a fourth variable encoded as size on top of the three ternary axes.

Variant "bubble"Aliases bubble / sized / weighted / proportional
Preview

Same layout as basic, with each point's label printed beside it — useful once you need to identify specific observations, not just see the overall distribution.

Variant "labeled"Aliases labeled / labelled / annotated / named
Preview