# TernaryListPlot

TernaryListPlot[{{u1,v1,w1},,{un,vn,wn}}]

plots a list of points with specified u, v and w coordinates in a barycentric coordinate system.

TernaryListPlot[{data1,data2,}]

plots a ternary plot with several datasets datai.

# Details and Options

• Ternary plots are also known as triangle plots or triaxial plots.
• Ternary plots are typically used to show relative proportions among three components in a whole, such as composition of soil in geology, elements in a mixture in chemistry or sources of calories in nutrition.
• Each point {ui,vi,wi} is normalized by using ui/ti, vi/ti and wi/ti, where ti=ui+vi+wi.
• Points with negative or nonreal coordinates will be taken as missing data.
• The transformation from the point {u,v,w} in barycentric coordinates to {x,y} in Cartesian coordinates is given by {x=v+w, y=w}.
• TernaryListPlot draws points inside an equilateral triangle, with the u, v and w coordinates corresponding respectively to the bottom, right and left edges.
• Coordinates ui, vi and wi can be given in the following forms:
•  ui a real-valued number Quantity[ui,unit] a quantity with a unit
• Values that are not of the form shown previously are taken to be missing and are not shown.
• The datai have the following forms and interpretations:
•  <|"k1"{u1,v1,w1},"k2"{u2,v2,w2},…|> values {y1,y2,…} {{u1,v1,w1}"lbl1",{u1,v1,w1}"lbl2",…}, {{u1,v1,w1},{u1,v1,w1},…}{"lbl1","lbl2",…} values {y1,y2,…} with labels {lbl1,lbl2,…} SparseArray values as a normal array TimeSeries, EventSeries time-value pairs QuantityArray magnitudes NumericArray values as a normal array WeightedData unweighted values
• The following wrappers w can be used for the datai:
•  Annotation[datai,label] provide an annotation for the data Button[datai,action] define an action to execute when the data is clicked Callout[datai,label] label the data with a callout Callout[datai,label,pos] place the callout at relative position pos EventHandler[datai,…] define a general event handler for the data Hyperlink[datai,uri] make the data a hyperlink Labeled[datai,label] label the data Labeled[datai,label,pos] place the label at relative position pos Legended[datai,label] identify the data in a legend PopupWindow[datai,cont] attach a popup window to the data StatusArea[datai,label] display in the status area on mouseover Style[datai,styles] show the data using the specified styles Tooltip[datai,label] attach a tooltip to the data Tooltip[datai] use data values as tooltips
• Wrappers w can be applied at multiple levels:
•  {…,w[{ui,vi,wi}],…} wrap the point {ui,vi,wi} w[datai] wrap the data w[{data1,…}] wrap a collection of datai w1[w2[…]] use nested wrappers
• Callout, Labeled and Placed can use the following positions pos:
•  Automatic automatically placed labels Above positions above data or points Below positions below data or points Before positions before data or points After positions after data or points {pos,epos} epos in label placed at relative position pos of the data
• TernaryListPlot has the same options as Graphics, with the following additions and changes: [List of all options]
•  AspectRatio Automatic ratio of width to height ColorFunction None how to determine the coloring of points ColorFunctionScaling True whether to scale arguments to ColorFunction Frame True whether to put a frame around the plot GridLines Automatic grid lines to draw GridLinesStyle {} how to style grid lines Joined False whether to join points LabelingFunction Automatic how to label points LabelingSize Automatic maximum size of callouts and labels PerformanceGoal \$PerformanceGoal aspects of performance to try to optimize PlotLabel None overall label for the plot PlotLabels None labels for data PlotLegends None legends for data PlotMarkers None markers to use to indicate each point PlotRange Automatic range of values to include PlotStyle Automatic graphics directives to determine styles of points PlotTheme \$PlotTheme overall theme for the plot TargetUnits Automatic units to display in the plot TernaryPlotCorners Automatic how to position the plot corners
• The setting PlotRange{rangeu,rangev,rangew} uses the given ranges for each of the three axes. The ranges will be extended to ensure a whole triangle is shown.
• Options that apply to each coordinate dimension, such as Axes, Frame and GridLines, can take the following forms:
•  s use regular setting s for each dimension {su,sv,sw} use setting su for the u direction etc.
• The setting will inherit the style used by axes or frames to draw the corresponding grid lines.
• The arguments to ColorFunction are , and . By default, they are scaled so that the smallest values are zero and the largest values are one.
• Setting uses the unscaled, normalized values for the points.
• When using data with units, the units for all components must be compatible.
• TargetUnitsunit specifies what unit to use.
• ## List of all options

•  AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of width to height Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ColorFunction None how to determine the coloring of points ColorFunctionScaling True whether to scale arguments to ColorFunction ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame True whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GridLines Automatic grid lines to draw GridLinesStyle {} how to style grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic Joined False whether to join points LabelingFunction Automatic how to label points LabelingSize Automatic maximum size of callouts and labels LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use PerformanceGoal \$PerformanceGoal aspects of performance to try to optimize PlotLabel None overall label for the plot PlotLabels None labels for data PlotLegends None legends for data PlotMarkers None markers to use to indicate each point PlotRange Automatic range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotStyle Automatic graphics directives to determine styles of points PlotTheme \$PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame TargetUnits Automatic units to display in the plot TernaryPlotCorners Automatic how to position the plot corners Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks

# Examples

open allclose all

## Basic Examples(4)

Generate a ternary plot for a list of points whose values add up to 1:

Plot several sets of data:

Label points with indices:

Use plot markers to identify different sets:

## Scope(34)

### General Data(5)

Plot sets corresponding to fixed fractions of the first element "A":

Second element "B":

Third element "C":

Plot sets corresponding to fixed ratios of the element "B" to "C":

"A" to "B":

"A" to "C":

Each data point is independently normalized so the elements sum to 1:

Nonreal and negative data is taken to be missing:

Multiple datasets are styled differently:

### Special Data(4)

Plot data with units:

Specify the desired target units:

Use data with quantities:

Specify strings to use as labels:

Specify a location for labels:

### Data Wrappers(5)

Use wrappers on individual data, datasets or collections of datasets:

Wrappers can be nested:

Call out a point:

Set a Style for each dataset:

Apply nested wrappers:

### Labeling and Legending(12)

Label individual points:

Label every point:

Label data with Labeled:

Label data with PlotLabels:

Label data with Callout:

Use Placed to control label positions:

Label points at automatically optimized positions:

Specify PlotLegends for each dataset:

Specify the maximum size of labels:

Use the full label:

For dense sets of points, some labels may be turned into tooltips by default:

Include legends for each dataset:

Use Legended to provide a legend to a specific dataset:

Use Placed to change the legend location:

Use association keys as labels:

### Presentation(8)

Multiple sets are automatically colored to be distinct:

Provide explicit styling to different sets:

Color points with ColorFunction:

Color by bottom, right and left coordinates:

Use different plot markers:

Join a list of points:

Style datasets or collections of datasets:

Specify grid lines:

Show no frames:

Set FrameTicksStyle:

Show barycentric axes:

Style axes:

Show axes and set the frame off to show the 0% lines:

## Options(36)

### Axes(1)

Show barycentric axes:

Set barycentric axes for given coordinates:

Style axes:

### Background(1)

Change the overall background color:

Change the backdrop color:

### ColorFunction(3)

Color points by the x direction value:

Color points by a function:

Color by bottom, right and left coordinates:

ColorFunction overrides PlotStyle:

### ColorFunctionScaling(2)

Use to get an unscaled value:

ColorFunctionScaling by default is True:

### Frame(1)

Show frames:

Show no frames:

Show part of frames:

Show the 0% lines when the frame is off:

### FrameLabel(1)

Place labels on each frame:

### FrameStyle(1)

Style frames:

Automatic GridLinesStyle are inherited from FrameStyle:

Change frame thickness:

### FrameTicks(1)

Change tick positions:

### FrameTicksStyle(1)

Change tick styles:

### GridLines(2)

Draw grid lines:

No grid lines:

Draw grid lines at specific positions:

Draw styled grid lines:

GridLines overrides GridLinesStyle:

### GridLinesStyle(1)

Style grid lines:

Style grid lines in each direction:

### Joined(2)

Points are joined in order of data:

Show points when joined:

### Method(5)

Set highlighting:

Change highlight color:

Use highlighting for axes and frames:

Change the background color of the area with data:

The backdrop area is associated with PlotRange:

### PlotLabels(3)

Label points at automatically optimized positions:

Use Placed to control label positions:

Label two sets of data:

### PlotLegends(1)

Show Automatic legends for different datasets:

Specify legends for each dataset:

Specify legends for each dataset using PlotMarkers:

### PlotMarkers(3)

Use a default sequence of shapes to distinguish datasets:

Do not use plot markers:

Use text or typeset labels to distinguish datasets:

Use any graphic to distinguish datasets:

Control font sizes for text markers:

Control sizes for graphics markers relative to the plot:

Control absolute sizes for graphics markers:

Use preset names to control graphics marker size:

### PlotRange(1)

Plot range by default is from 0 to 1 in all directions:

### PlotStyle(3)

Change the size of points:

Color each dataset:

Color datasets cyclically:

### TargetUnits(1)

Plot data with units:

Specify the desired target units:

### TernaryPlotCorners(1)

By default, the plot corners are positioned anticlockwise:

Position the plot corners clockwise:

Place the corners at given coordinates:

## Applications(7)

### Geology(2)

Plot a soil texture triangle:

Plot a soil texture triangle with shaded regions:

### Agriculture(2)

Plot the fraction of fertilizers used each year:

Show the planted fractions of three crops, corn, soybeans and wheat:

### Other(3)

Show the sources of electricity for countries around the world:

Show the fraction of child, adult and elderly populations around the world:

Show the fractions of fat, carbohydrates and proteins in a variety of foods:

Wolfram Research (2022), TernaryListPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/TernaryListPlot.html.

#### Text

Wolfram Research (2022), TernaryListPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/TernaryListPlot.html.

#### CMS

Wolfram Language. 2022. "TernaryListPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TernaryListPlot.html.

#### APA

Wolfram Language. (2022). TernaryListPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TernaryListPlot.html

#### BibTeX

@misc{reference.wolfram_2024_ternarylistplot, author="Wolfram Research", title="{TernaryListPlot}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/TernaryListPlot.html}", note=[Accessed: 19-September-2024 ]}

#### BibLaTeX

@online{reference.wolfram_2024_ternarylistplot, organization={Wolfram Research}, title={TernaryListPlot}, year={2022}, url={https://reference.wolfram.com/language/ref/TernaryListPlot.html}, note=[Accessed: 19-September-2024 ]}