LabCanvas
Free account · save your work, full figure editorSign up free

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.

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
a=AA+B+C, …x=c+a2y=32a
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).

Last updated

FreeNo sign-upRuns in your browserFigures

Loading Ternary plot maker…

At a glance

Ternary plot maker at a glance
InputThree composition columns; optional text column (series) and fourth number column (colour)
NormalisationEach row divided by its total; % or fractions detected
DrawingRegions filled, tie lines joined, samples as points; colour scale with colour bar
AccuracyFractions and positions match NumPy to 10⁻¹²
ExportPNG at 300 or 600 dpi, CSV of compositions with x, y; editable in the Graph app
Runs inYour web browser; nothing is uploaded
PriceFree, no account needed

What it does

How to use the ternary plot maker

  1. Paste your compositionsThree 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 coloursA 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. ExportDownload 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.

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 (12,32), 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+a2,y=32a

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. 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.

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.

How the series are drawn
Series name containsDrawn asUse for
region, phase, binodal, area, zone, fieldFilled polygonTwo-phase regions, stability fields
line, tie, curve, boundary, path, liquidusLine (blank rows break it)Tie lines, phase boundaries, reaction paths
anything elsePointsSamples, 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×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.

Frequently asked 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.

Put the ternary diagram in a figure

The LabCanvas Graph app draws ternary, contour and polar graphs next to your other plots, styled for journals. Your compositions from this page open in it.

Open the Graph app