Learn R Programming

⚠️There's a newer version (3.5.0) of this package.Take me there.

ggtern

An extension to ggplot2, for the creation of ternary diagrams.

ggtern is a package that extends the functionality of ggpot2, giving the capability to plot ternary diagrams for (subset of) the ggplot2 proto geometries. Ternary diagrams are used frequently in a number of disciplines to graph compositional features for mixtures of three different elements or compounds. It is possible to represent a coordinate system having three (3) degrees of freedom, in 2D space, since the third dimention is linear and depends only on the other two.

The ggtern package is based on (extends) the very popular ggplot2 package, which is an implementation of Wilkinsons "The Grammar of Graphics", and, makes provision for a highly methodical construction process for the development of meaningful (graphical) data representations. Of course, the above book by Wilkinson outlines the theory, whilst Hadley Wickhams ggplot2 implementation is where much of the magic happens, and, an ideal base-platform for the ggtern package.

For further examples and documentation, please proceed to the ggtern website.

Copy Link

Version

Install

install.packages('ggtern')

Monthly Downloads

2,719

Version

2.1.4

License

GPL-2

Last Published

July 21st, 2016

Functions in ggtern (2.1.4)

convenience_functions

Theme Convenience Functions
aes

Modified Aesthetic Mappings
annotate

Create an annotation layer (ggtern version).
data_sets_USDA

USDA Textural Classification Data
draw_key_tern

Key drawing functions
geom_mask

Apply Manual Clipping Mask
mahalanobis_distance

Mahalanobis Distance
data_sets_Feldspar

Elkin and Groves Feldspar Data
data_sets_Fragments

Grantham and Valbel Rock Fragment Data
annotation_raster_tern

Annotation: High-performance rectangular tiling, ggtern version
ggsave

Save a ggplot (or other grid object) with sensible defaults (ggtern version)
ggplot_gtable

Build a plot with all the usual bits and pieces.
ggplot_build

Build ggplot for rendering.
getBreaks

Generate Axis Breaks and Labels
ggtern_labels

Change Axis labels and legend titles
geom_Xline

Fixed Value Lines
ggplot

Create a new ggplot plot.
geom_point_swap

Points (Colour and Fill Swapped), as for a scatterplot
ggplotGrob

Generate a ggplot2 plot grob.
geom_smooth_tern

Add a Smoothed Conditional Mean.
zzz-overloaded

Overloaded ggplot2 functions
position_nudge_tern

Nudge Ternary Points.
+.gg

Plot Construction
position_jitter_tern

Jitter ternary points to avoid overplotting.
ggtern

ggtern Constructor
ggtern_package

Ternary Diagrams in R
ggtern_themes

ggtern themes
kde2d.weighted

Two-Dimentional Kernel Density Estimation (Weighted)
arrangeGrob

Arrange multiple grobs on a page (ggtern version)
label_formatter

label_formatter is a function that formats / parses labels for use in the grid.
theme_mesh

Create Grid Mesh
scale_T_continuous

Continuous position scales (T, L & R).
suffix_arrow

Atomic, Weight or Custom Percentage Suffix
theme_gridsontop

Render Grids on Top
tern_limits

Restrict Ternary Limits
ternary-transformation

Ternary / Cartesian Transformation
theme_bordersontop

Render Borders on Top
strip_unapproved

Strip Unapproved Layers
theme_complete

Complete Themes
theme_clockwise

Direction of Ternary Rotation
theme_legend_position

Position Legend in Convenient Locations
theme_novar_tern

Blank one variable's annotations in ternary plot
theme_rotate

Rotate Ternary Diagram
theme_showgrid

Show or Hide Grid
themearrowlength

Change the Length of the Ternary Arrows
theme_nomask

Show or Hide the Clipping Mask
theme_showtitles

Show or Hide the Axis (Apex) Titles
theme_noarrows

Show or Hide the Ternary Arrows
theme_showprimary

Show or Hide the Primary/Secondary Ticks
theme_showlabels

Show or Hide Axis Ticklabels
zzz-internal

Internal Functions
theme_ticksoutside

Place Ticks Inside or Outside
transform_position_tern

Convenience function to transform all position variables in a ternary plot
zzz-depreciated

Depreciated Functions