Skip to content

Illustrate three variables that sum to 100 % in a triangle graph

Notifications You must be signed in to change notification settings

tervio/shares-triangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shares-triangle plots

Illustrate three variables that sum to 100 % in a triangle where coordinates are {x, y} and where the redundant third dimension y2 := 100 - x - y is depicted with gridlines and labels. This triangle is also known as the probability triangle, used to depict mixed strategies in games with three actions (e.g., "Rock, paper, scissors").

Example output (graphs/) can be reconstructed by evaluating the notebook SharesTriangle_Maker.nb

Example data (csv/) was retrieved from the World Bank on 2023-01-06, using handpicked API calls here: https://data.worldbank.org/indicator/SP.POP.65UP.TO
The classification into {children, working age, elderly} at age ranges {0-14, 15-64, 65-} is a bit loopy but follows a long tradition across statistical agencies.

Example output

Example plots depict the evolution of age group population shares in selected countries. Data from the World Bank (CC BY-4.0).

Preview plot of the entire shares-triangle

The preview plot shows the location of all data points inside the complete shares triangle. This can be useful for deciding on how to customize the shares-triangle plot.

Customized shares-triangle plot

In this shares-triangle plot some of the graph options were selected at the SharesTriangle_Maker.nb partly based on the look of the above preview plot. Option values that result in a useful graph depend on the data, for example how densely the plotted points are packed inside the triangle.

Custom shares-triangle plot

About

Illustrate three variables that sum to 100 % in a triangle graph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published