Articles by Nicholas Hamilton

Version 2.2.2 Released

January 19, 2018 | Nicholas Hamilton

ggtern version 2.2.2 has just been submitted to CRAN, and it includes a number of new features. This time around, I have adapted the hexbin geometry (and stat), and additionally, created an almost equivalent geometry which operates on a triangular mesh rather than a hexagonal mesh. There are some subtle differences ... [Read more...]

ggtern: Version 2.2.1 Released

July 22, 2017 | Nicholas Hamilton

It has been a while since any kind of significant update has been released for the ggetern library, and the other day a minor update was submitted to CRAN, which is now available. There were a few minor bug fixes, and the inclusion of a few new geometries which some ... [Read more...]

Version 2.1.1 Released

March 31, 2016 | Nicholas Hamilton

Hi Folks, ggtern v2.1.1 has just been submitted to CRAN. This includes a number of minor bug fixes, and an additional annotation, permitting the rendering of raster data, say for the inclusion of images. This post will demonstrate the use of this requested feature. Demonstration of Raster Annotation Several people ... [Read more...]

Version 2.1.0 Released

March 17, 2016 | Nicholas Hamilton

Version 2.1.0 has just been submitted to CRAN and should be available over the next day or so. This version primarily resolves the recent errors that people have been encountering when using ggtern with the most recent version of ggplot2 (v2.1.0). Specifically, the following errors recently emerged, due to (amongst other ... [Read more...]

ggtern 2.0 now available

January 16, 2016 | Nicholas Hamilton

Recently ggplot2 received a severe makeover by releasing version 2.0, and in the spirit of improvement, I thought ggtern should also get an overhaul, so after a few-hundred hours of code review, here is what has changed: Theme elements: Previously, the nomenclature scheme for the new theme elements was a bit ... [Read more...]

Ternary Interpolation / Smoothing

August 3, 2015 | Nicholas Hamilton

For a long time, people have been sending me requests for a suitable smoothing / contouring / interpolation geometry be made available via ggtern, over and above the Kernel Density function. I am very pleased to say, that the recent version 1.0.6 has this feature added. Let me demonstrate how it works. This ... [Read more...]

User Request – Shepards Classification of Sediments

July 25, 2014 | Nicholas Hamilton

I received a request overnight on how to render the Shepard’s classification diagram, which is an alternative to the USDA’s textural soil classification. This is quite simple to produce (albeit a little tedious), however, before I walk through the script, immediately below, please see the final result (which ... [Read more...]

User Request – Disable Limiting Region

June 16, 2014 | Nicholas Hamilton

The other week a user of ggtern ran into a problem where they wanted to use the limit_tern(...) functionality, however there were a few marginal points / paths that extended beyond the limiting region. Under normal circumstances, the standard ggtern behaviour is to strip these points, which can interfere with ... [Read more...]

ggtern on CRAN

June 3, 2014 | Nicholas Hamilton

An update to ggtern, version, is now available on CRAN! This version includes a number of bug fixes: Added convenience functions, and global options for modifying the length of the ternary arrows easily. Fixed broken ggsave function, which was not using the local print function. Fixed geom_errorbarR reference in ... [Read more...]

New Geometry – Ternary Errorbars

February 2, 2014 | Nicholas Hamilton

ggtern has introduced a new series of geometries to represent known errors in data, they are relatively easy to use and are along the lines of the geom_errorbar(...) and geom_errorbarh(...) geometries in ggplot2. Analagous the errorbars in ggplot2, in ggtern, the new geometries [and additional required mappings] are ...
[Read more...]

ggtern on CRAN

February 1, 2014 | Nicholas Hamilton

An update to ggtern, version, is now available on CRAN! This version includes a number of updates and functionality, which can be summarized below: Inclusion of USDA Soil Classification Data, accessed by: data(USDA) Creation of New geometries for ternary errorbars, ie, geom_errorbarT, geom_errorbarL and geom_errorbarR Creation ... [Read more...]

USDA Textural Soil Classification

January 15, 2014 | Nicholas Hamilton

Included in the next version ( of ggtern, will be a new data set, taken from the USDA Textural Soil Classification[1] which we can use to reproduce the original diagram published by the United Stated Department of Agriculture. Firstly let us load the packages and data: Reconstructing the USDA’s Original ...
[Read more...]

User Request – Middle Segments

January 9, 2014 | Nicholas Hamilton

Recently, a user of ggtern was desirable to produce a plot similar to what can be found HERE. This is relatively simple, given the use of layers during plot construction. In ggplot2 (and hence ggtern), one can define a 'global' dataframe in the constructor, which gets picked up by each ...
[Read more...]

ggtern on CRAN

January 4, 2014 | Nicholas Hamilton

An update to ggtern, version, is now available on CRAN! This version includes a number of updates, and, additional functionality, which can be summarized below: Better Documentation Theme commands were brought back inline with the ggplot2 format, for example, theme_tern_bw() has been superceded by theme_bw() as per ... [Read more...]

ggtern on CRAN

December 18, 2013 | Nicholas Hamilton

ggtern is now available on CRAN!   Since this was my first official package in R, I was pleasantly surprised at the rigour demonstrated by the volunteers in enforcing the many quality control standards! CRAN Landing Page for ggtern: The... [Read more...]

New Geometry – Confidence Regions

December 17, 2013 | Nicholas Hamilton

geom_confidence(…) One of the first suggestions that was presented to me, was by Sean Mulcahy, whom suggested that it would be a good idea to consider confidence regions, as presented HERE. I am plesed to say that a new geometry (geom_confidence) has been created, and, is available since ...
[Read more...]

PPS 3-State Model

December 16, 2013 | Nicholas Hamilton

I recently found THIS site on the internet which I thought would be another good case-study. As a standalone figure, it can be rendered as follows with ggtern: However, in order to distinguish the different categories, perhaps a facetted approach would be better: The post PPS 3-State Model appeared first ...
[Read more...]

New Geometry – Tline, Lline & Rline

December 16, 2013 | Nicholas Hamilton

The latest version of ggtern,, has several bug-fixes and improvements. One worth mentioning, is the creation of some new geometries to assist in the plotting of constant value lines, analogous to hline and vline in ggplot2. For Lines of constant T value: For Lines of constant L value: For Lines ...
[Read more...]


December 12, 2013 | Nicholas Hamilton

Sean Mulcahy made an example of plotting Elkin and Grove's 1990 Feldspar Data. Here is an equivalent plot in three variables: Phase (Shape) Temperature (Color Gradient), and; Pressure (Size) Code to Produce the Above… The post Feldspar appeared first on ggtern: ternary diagrams in R.
[Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)