# Ternary plot maker

> Paste three-part compositions and get a ternary diagram: phase regions, tie lines, points coloured by a value. PNG at 300 or 600 dpi. Free, no sign-up.

URL: https://www.labcanvas.com/tools/ternary-plot-maker

Paste three columns of compositions (percentages, fractions or any amounts: each row is rescaled to 100%) and the tool draws a ternary diagram with the first column at the top corner and the other two at the bottom left and right. Add a text column to group rows into series (a name with “region” is filled, as a phase region; “line” or “tie” is joined, as tie lines; anything else is drawn as points) or a fourth number column to colour the points by a value. Download a 300 or 600 dpi PNG or open it in the LabCanvas Graph app.

## Quick answer

- **What it does:** Draws three-part compositions in an equilateral triangle, with filled regions, joined lines and points by series, and points coloured by a fourth value.
- **Formula:** Fractions a = A/(A + B + C), b, c; position in a triangle of side 1: x = c + a/2, y = (√3/2)·a (A at the top, B bottom left, C bottom right).
- **Example:** A soil with 13.1% clay, 44.4% silt and 42.5% sand sits at x = 0.425 + 0.131/2 = 0.491, y = 0.866 × 0.131 = 0.113 (clay at the top corner).

Free, in the browser, no account needed. Updated 2026-11-17.

## Features

- Any three-part composition: mass or mole %, fractions, or raw amounts (each row is rescaled to its total)
- Series from a text column: regions filled (phase diagrams), tie lines and boundaries joined, samples as points
- Points coloured by a fourth number column, with a colour bar (viridis, cividis, magma and more)
- Grid lines and ticks on all three edges every 5, 10, 20 or 25%
- Two worked examples: a water–acetone–toluene phase diagram with tie lines, and soil textures coloured by organic carbon
- Copy the normalised compositions with their x, y positions; PNG at 300 or 600 dpi; nothing is uploaded
- Opens in the LabCanvas Graph app as an editable ternary graph

## How to use it

1. **Paste your compositions**: Three number columns with their names in the first row: the first is the top corner, the second bottom left, the third bottom right.
2. **Add series or colours**: A text column groups rows (name a series “… region” to fill it, “tie line …” to join it; a blank row breaks a line). A fourth number column colours the points.
3. **Export**: Download a PNG at 300 or 600 dpi, copy the chart or the normalised table, or open the diagram in the Graph app to edit it.

## At a glance

| | |
| --- | --- |
| Input | Three composition columns; optional text column (series) and fourth number column (colour) |
| Normalisation | Each row divided by its total; % or fractions detected |
| Drawing | Regions filled, tie lines joined, samples as points; colour scale with colour bar |
| Accuracy | Fractions and positions match NumPy to 10⁻¹² |
| Export | PNG at 300 or 600 dpi, CSV of compositions with x, y; editable in the Graph app |

## How it works

**Normalising.** A ternary diagram shows three parts that add up to a whole. Each row \((A, B, C)\) is divided by its total, \(a = A/(A + B + C)\) and likewise \(b\) and \(c\), so rows in %, in fractions or in grams all land in the right place; rows whose parts do not add up to 100 (or 1) are counted in a note. Rows with a missing or negative part are left out.

**Position.** In an equilateral triangle of side 1 with the first component \(A\) at the top \((\tfrac12, \tfrac{\sqrt3}{2})\), \(B\) at the bottom left \((0, 0)\) and \(C\) at the bottom right \((1, 0)\), a composition is the weighted average of the corners:

$$x = c + \frac{a}{2}, \qquad y = \frac{\sqrt{3}}{2}\,a$$

The lines of constant \(a\) run parallel to the base (B–C edge), the lines of constant \(b\) parallel to the right edge and those of constant \(c\) parallel to the left edge; the tick labels on each edge are read along those lines.

**Series.** A text column splits the rows into series in table order. Series whose name contains region, phase, binodal, area or field are drawn as filled polygons; names with line, tie, curve, boundary or path as lines (a blank row starts a new line, so several tie lines can share one series); other series as points. A fourth number column colours the points through a perceptually uniform colour scale (Crameri et al. 2020).

**Accuracy.** The drawing is the LabCanvas Graph app’s ternary graph, run in your browser. For both examples, every normalised fraction and position matches NumPy to 10⁻¹² (scripts/ternary-plot-maker-check.ts).

Sources: Hamilton NE, Ferry M. ggtern: ternary diagrams using ggplot2. *J Stat Softw* 2018;87(Code Snippet 3):1–17, [doi:10.18637/jss.v087.c03](https://doi.org/10.18637/jss.v087.c03). Crameri F, Shephard GE, Heron PJ. The misuse of colour in science communication. *Nat Commun* 2020;11:5444, [doi:10.1038/s41467-020-19160-7](https://doi.org/10.1038/s41467-020-19160-7).

## Worked example: a liquid–liquid phase diagram and soil textures

**Phase diagram.** The built-in example is a water–acetone–toluene system at 25 °C in mass % (synthetic, labelled as demo data): 25 points on the binodal curve in a series named “Two-phase region (binodal)”, which is filled; five tie lines in a series named “Tie lines”, two rows each with a blank row between them, which are joined; the plait point and three feed mixtures as points. Acetone is the first column, so it sits at the top.

| Series name contains | Drawn as | Use for |
| --- | --- | --- |
| region, phase, binodal, area, zone, field | Filled polygon | Two-phase regions, stability fields |
| line, tie, curve, boundary, path, liquidus | Line (blank rows break it) | Tie lines, phase boundaries, reaction paths |
| anything else | Points | Samples, feeds, measured compositions |

**Soil texture by hand.** Load the soil example (45 synthetic samples, clay–silt–sand, coloured by organic carbon). The first sample has 13.1% clay, 44.4% silt and 42.5% sand, which add up to 100, so \(a = 0.131\), \(b = 0.444\), \(c = 0.425\). Its position is \(x = 0.425 + 0.131/2 = 0.4905\) and \(y = 0.866 \times 0.131 = 0.1134\): low in the triangle (little clay) and just left of the middle (a little more silt than sand). Copy compositions gives these numbers for every sample.



## Questions

### How do I make a ternary plot?

Paste three columns of compositions with their names in the first row. The first column becomes the top corner. Add a text column to group the rows into regions, lines and points, or a fourth number column to colour the points, then download the PNG.

### Do my values have to add up to 100?

No. Each row is divided by its total, so percentages, fractions and raw amounts all work. The note under the plot says how many rows did not add up to 100 and were rescaled.

### How do I read a ternary diagram?

Each corner is 100% of one component and the opposite edge is 0% of it. To read component A, follow the line through the point parallel to the edge opposite A to A’s scale. The three readings add up to 100%.

### How do I draw tie lines or a phase region?

Put the rows in a series whose name contains “tie” (two rows per tie line, a blank row between lines) or “region” (the boundary points in order around the region). The tool joins or fills them automatically.

### Can I make a soil texture triangle?

Yes: paste clay, silt and sand %. Clay goes first to sit at the top. The tool plots the samples; the USDA texture class boundaries can be added in the LabCanvas Graph app or editor as a region series.

### Can I colour points by a fourth variable?

Yes. A fourth number column colours the points through a colour scale with a colour bar; choose the scale under More options.
