How to Make Ternary Plots in R, with ggplot2

When you want to compare between three parts of your data, ternary plots might be a good option. Here is how to make them.

You might not have heard about ternary plots, but in some fields they are quite popular. In chemistry, for example, they are used to show the characteristics of 3-component alloys and 3-component gas mixtures.

In soil sciences, they are ubiquitous. Soils are classified by the fractions of silt, clay and sand:

USDA soil classification ternary plot
See Wikipedia for more.

Imagine a soil scientist wanting to classify a soil sample composed of 50 percent clay, 30 percent sand and 20 percent silt. Plotted on a ternary plot, the sample would be placed like this (take note of the colors):

Looking back at the first ternary plot above, you can see that this sample would be classified as a clay soil.

The way countries source energy from fossil fuels, renewables and nuclear energy is another 3-component mixture that lends itself very well to visualization with ternary plots. In this tutorial, you’ll learn how to read ternary plots, and how to make them with ggplot2.

To access this full tutorial and download the source code you must be a member. (If you are already a member, log in here.)

Get instant access to this tutorial and over a hundred more, plus courses, guides, and additional resources.


You'll get unlimited access to hundreds of hours worth of step-by-step visualization courses and tutorials for insight and presentation — all while supporting an independent site. Source code and data is included so that you can more easily apply what you learn in your own work.

The tutorials are very helpful to move from "Oooo, cool!" to how to actually DO the cool.

Members also recieve a weekly newsletter, The Process. Keep up-to-date on visualization tools, the rules, and the guidelines and how they all work together in practice.

See samples of everything you gain access to:

About the Author

Maarten is a data journalist and data visualization consultant from Belgium. He likes maps, ggplot and a good story.