This zip files contains programs (five functions, one example program, and one sample data set) to plot data in ternary diagrams. The first option is a pseudo color plot, the second is a contour plot, and the third style plots the data as color coded symbols (similar to my function 'plot3c'). An additional function is provided to add labels.
The example program (termain.m) shows how to use the functions and how to modify the different plots.
Ulrich Theune (2021). Ternary Plots (https://www.mathworks.com/matlabcentral/fileexchange/7210-ternary-plots), MATLAB Central File Exchange. Retrieved .
How to make a ternary plot with a specified range of values instead of the entire triangle?
Thank your for this excellent job sharing for us.
Hi, Thank you for sharing the code.
Does someone know how could change the axis limits?
Excellent code ! Did exactly what I wanted to do.
Hi, great code. My variables have different ranges. It is possible to change the axis limits? Thank you
first of all excellent job. Just one question, is it possible to change the scale on the axis?
very nice, thanks :)
Nicely commented and easy to follow! Thank you!
thank you. Wonderful work.
Hello, I have a question.
Is it possible to plot some data points in 3D also with ternaryc function ?
My surface is defined :
and then I plot the points:
Thanks for sharing the code. What should I modify in the code to get the scale 0.2 - 0.4 instead of 0 - 1.0?
Thanks a lot. This code helped me a lot.
I see that some people ask for changing the range of axis, they can simply modify related functions. It takes only a few minutes.
I am making a ternary plot of composition with color being Octane number. How do I get the color scaling to be the same for my 3 separate functions?
The intersect points have the same composition thus, the same Octane yet the colors do not match. The data is correct and the values are the same.
How do you input your own data on to this plot?
Thanks for sharing, nice work!
Thanks a lot for sharing ;) This is a lot easier with an example!!!! :)
Thanks for sharing.
Thanks a lot!
Thanks a lot
How can i get this file?
These functions relative on the ternary plot are not working at Matlab 2013b.I didn't find "ternary plot" in the "help" of the Matlab 2013b too. Does anybody know what's happening?
Thanks a lot.
I'm not able to view the file!!
Thanks, just thanks
Chemical Engineers like me find this very useful for ternary LLL equilibrium .
Sorry for my English, I am form Colombia.
very useful! however, i can't figure out how to change the tick intervals... please help. thanks
Jeremy's changes are correct, but there is an additional correction that should be made, as c1 + c2 + c3 should always equal 1.
If input arguments sum to less than one but are not fractional, ternaryc will misrepresent data position because it only reads c1 and c2 for alignment. E.G., ternaryc(0.2,0.1,0.1) plots as though it is 20%, 10%, 70% instead of 50%, 25%, 25%.
To ensure the sum is 1, I added 2 lines and reformatted lines 52-57. New code looks at each line of input data and makes sure it is fractional. If not, fractional values are calculated.
change lines 52-57 to this:
otherwise you end up using the normalized values to normalize the second and third steps.
If you try to plot (1,1,1) it is not the same location as seen with Origin 7 ... why?
Great tool! Just what I was looking for. Also very well commented source code!
Basic functionality is OK, but there is a persistent "
Warning: Color Data is not set for Interpolated shading", and the default tickmarks are very closely spaced (when used in subplots)
Very useful functionality & a good data set. I've used termain as a geophysics demonstration.
The files could be made slightly more robust to different output data (e.g. it errored with constant data)
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!