Skip to content
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions examples/gallery/embellishments/ternary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Ternary diagram
---------------

To plot circles (diameter = 0.1 cm) on a 10-centimeter-wide ternary diagram at the
positions listed in the sample dataset `rock_compositions`, with default annotations and
gridline spacings, using the specified labeling.
"""

import pygmt

fig = pygmt.Figure()

data = pygmt.datasets.load_sample_data(name="rock_compositions")

pygmt.makecpt(cmap="batlow", series=[0, 80, 10])

fig.ternary(
data,
region=[0, 100, 0, 100, 0, 100],
width="10c",
style="c0.1c",
alabel="Limestone",
blabel="Water",
clabel="Air",
cmap=True,
frame=[
'aafg+l"Limestone component"+u" %"',
'bafg+l"Water component"+u" %"',
'cagf+l"Air component"+u" %"',
"+givory",
],
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
)

fig.show()