Skip to contents

Draw a 2D ternary plots

Main plotting functions for ternary diagrams

add_ternary_base()
Draw the 2D ternary simplex
geom_ternary_region() stat_ternary_region() StatTernaryRegion
Create polygonal regions in a ternary plot based on a reference point
add_vertex_labels()
Add vertex labels to ternary plot
stat_ordered_path() StatOrderedPath
Reorder observations for a path geom

Ternable object

Create a ternable object and prepare it for plotting

as_ternable()
Create a ternable object
get_tern_data() get_tern_edges() get_tern_labels()
Getter functions to extract components from ternable object for ternary plots

Data transformation

Prepare your PrefLib and distribution of preferences data for plotting

dop_transform()
Transform AEC distribution of preferences from long to wide format
dop_irv()
Get full distribution of preferences in each instant runoff voting round as percentage
helmert_transform()
Transform compositional data using Helmert matrix

Data

aecdop_2022 aecdop_2025
Distribution of preferences by candidate by division in the Australian Federal Election (2022 and 2025)
elb_centroid
Centroids of electoral divisions in the 2025 Australian Federal Election
elb_map
Electoral boundaries map for the 2025 Australian Federal Election