How to reverse the axis of the psternary plot?

Dear Community,

I have been trying to reverse the axis of the ternary plot for hours using GMT 5.4. Currently, the bottom axis is 0 to 100, but I want to change it to 100 to 0 and alter other axes accordingly. That’s what people normally use in soil science. In basemap, I can reverse the axis by setting -J to minus, but it doesn’t work in psternary. Can somebody give me a hand? Thank you!


Sorry the delay. Could you send the psternary command you are trying, ideally with a test data set so I can have a look?

Hi Pwessel,

Thank you for responding! This is the command I am trying:

echo 0.1 0.3 0.6 > input
echo 0.3 0.5 0.2 >> input
echo 0.65 0.05 0.3 >> input

gmt psternary input -R0/100/0/100/0/100 -JX6i -Xc -Baafg+l"Percent Sand"+u"%%" ^
-Bbafg+l"Percent Silt"+u"%%" -Bcagf+l"Percent Clay"+u"%%" ^ -W2 -Sc0.2i -Cred -Y2i -K -P > %ps%
echo 0.5 0.5 0.9 | psternary -R -JX -Ba -Bb -Bc -W2 -Sc0.2i -Cblue -O -P >> %ps%
gmt psconvert %ps% -A0.5c -E300 -Tj

This is the output:

I would like the axis for Percent Sand to go from 0 to 100% from right to left; Percent Clay to go from 0 to 100% from bottom to top; and Percent Silt to go from 0 to 100% from top to bottom. Similar to this one:

I have tried -JX-6i but it didn’t do what I want.


Clockwise orientation of all axes has now been implemented and merged into master - as you tried, this requires a negative width. I have just added plotting of polygons and lines but this is still awaiting review (

Thank you, Paul!
Will that be available in a new version of GMT?


Yes, 6.2.0, hopefully this fall. Perhaps @Joaquim can tell us if there are any Windows installer builds of master.

Not with this changes, but maybe later this week. Keep an eye on