Menu

COMPOSITIONAL DATA

Create Ternary Plots in Seconds

Visualize three-component systems - soil texture, alloy composition, or chemical mixtures - with automatic normalization and triangular coordinate transforms.

Understanding Ternary Plots

A ternary plot (also called a triangle plot or simplex plot) displays the ratios of three variables that always sum to a constant (typically 100%). Each vertex of the equilateral triangle represents 100% of one component. The position of a data point within the triangle simultaneously encodes all three proportions - no information is lost.

The Constraint

A + B + C = 100%. This closure constraint means only 2 of the 3 variables are independent. The triangle naturally enforces this.

Reading Position

Draw a line from a point parallel to the opposite side of each vertex. Where it intersects the axis gives the percentage for that component.

Color Encoding

Add a 4th dimension by coloring points - by category (site, treatment) or continuously (temperature, hardness, yield).

Should You Use a Ternary Plot?

Use this quick decision check before building your figure to avoid forcing the wrong chart type.

Use a ternary plot when

  • Your three variables represent parts of one whole and sum to 100%.
  • You need to compare composition shifts across groups, sites, or batches.
  • You want to preserve all three proportions in a single view.

Choose another chart when

  • Your variables do not sum to a fixed total.
  • You only need pairwise relationships rather than full composition geometry.
  • You need a simpler stakeholder view - start with the chart gallery and compare options.

Soil Texture Triangle

The classic USDA soil classification triangle. Samples from four field sites are plotted by their Sand/Silt/Clay fractions. Each cluster reveals distinct soil characteristics.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • • Colors: Modify color values to see different palettes
  • • Numbers: Adjust sizes, positions, or data ranges
  • • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

Customization tips

  • Change axis labels and data to match your components (e.g., SiO2/Al2O3/CaO)
  • Adjust min axis values to zoom into a sub-region
  • Add contour lines for density mapping with go.Scatterternary fill mode

Ternary Plots Across Disciplines

FieldComponentsExample Use
Soil ScienceSand / Silt / ClayUSDA texture classification
MetallurgyFe / Cr / NiStainless steel phase diagrams
PetrologyQuartz / Feldspar / LithicsQFL provenance analysis
CeramicsSiO2 / Al2O3 / CaOGlaze composition optimization
EcologyCarbs / Protein / FatNutritional niche analysis
PharmacyDrug / Excipient / SolventFormulation design space

Alloy Phase Diagram

A materials science ternary showing Fe-Cr-Ni alloy compositions colored by measured hardness (Vickers). The continuous colorscale reveals how composition affects mechanical properties.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • • Colors: Modify color values to see different palettes
  • • Numbers: Adjust sizes, positions, or data ranges
  • • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

Why Scientists Use Plotivy for Ternary Plots

Auto-Normalization

Plotivy checks if rows sum to 100% and normalizes automatically - no preprocessing needed.

Full Code Export

Get clean Plotly Python code you can run locally, share with reviewers, or include in supplementary materials.

Interactive Hover

Hover over any point to see exact compositions. Zoom and pan into crowded regions of the triangle.

Continuous Color

Map a 4th variable (temperature, yield, hardness) to color using any Plotly colorscale.

Chart gallery

Explore More Scientific Charts

Interactive chart gallery with ready-to-run code

Browse all chart types →
Correlation heatmap with diverging color scale and coefficient annotations
Statistical•seaborn, matplotlib
From the chart gallery•Correlation analysis between variables

Heatmap

Represents data values as colors in a two-dimensional matrix format.

Sample code / prompt

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np

# Create correlation matrix for financial metrics
metrics = ['Revenue', 'Profit', 'Expenses', 'ROI', 'Customers', 'AOV', 'Marketing', 'Employees']
correlation_data = np.array([
    [1.00, 0.85, -0.45, 0.72, 0.88, 0.65, 0.72, 0.55],
    [0.85, 1.00, -0.78, 0.92, 0.75, 0.58, 0.63, 0.48],
Scatter plot of height vs weight colored by gender with regression line
Statistical•matplotlib, seaborn
From the chart gallery•Correlation analysis between metrics

Scatterplot

Displays values for two variables as points on a Cartesian coordinate system.

Sample code / prompt

import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import pandas as pd

# Generate sample data
np.random.seed(42)
n_samples = 200
height = np.random.normal(170, 8, n_samples)
weight = height * 0.6 + np.random.normal(0, 8, n_samples) - 50

Ready to Plot Your Compositions?

Upload your three-component data or describe it in plain English. Plotivy handles normalization, triangle coordinates, and styling.

Start Free - No Sign-Up