# Ternary plots

**URL:** <https://discourse.julialang.org/t/ternary-plots/60867>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [May 10, 2021, 9:13am UTC](https://discourse.julialang.org/t/ternary-plots/60867 "2021-05-10T09:13:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan.phi](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Post date:** [May 10, 2021, 9:13am UTC](https://discourse.julialang.org/t/ternary-plots/60867/1 "2021-05-10T09:13:46Z")

</div>

I am looking to replicate the figure below (from Wikipedia on the Dirichlet distribution). Is there any way to do this currently in Julia (the vertical color scale is not that important)?

![Dirichlet](https://global.discourse-cdn.com/julialang/original/3X/a/a/aa4c55d2d3c3f8b5de918620faf5d018c7b18193.png)

---

<div class="post-metadata">

**Author:** ![feanor12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feanor12/32/8212_2.png) [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Post date:** [May 10, 2021, 9:35am UTC](https://discourse.julialang.org/t/ternary-plots/60867/2 "2021-05-10T09:35:34Z")

</div>

This would also be useful for phase diagrams of ternary compounds.

I think plotly can do this, but I only see scatter plots in the example.

> **[Ternary](https://plotly.com/python/ternary-plots/)**
>
> Detailed examples of Ternary Plots including changing color, size, log axes, and more in Python.

Update:  
I also found the contour version:

> **[Ternary](https://plotly.com/python/ternary-contour/)**
>
> Detailed examples of Ternary contours including changing color, size, log axes, and more in Python.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 10, 2021, 9:39am UTC](https://discourse.julialang.org/t/ternary-plots/60867/3 "2021-05-10T09:39:43Z")

</div>

See work in progress on TernaryPlots.jl package [here](https://github.com/jacobusmmsmit/TernaryPlots.jl).

 ![TernaryPlot_contours](https://global.discourse-cdn.com/julialang/original/3X/f/2/f2f678f77e74941df63c8d3c7321b31d2b8c1b12.png)  
 ![ternary_plot_color_contours](https://global.discourse-cdn.com/julialang/original/3X/2/f/2fbdf707f44e11c9c3c00713ee65de1e587710dc.png)

---

<div class="post-metadata">

**Author:** ![Dan.phi](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Post date:** [May 10, 2021, 10:36am UTC](https://discourse.julialang.org/t/ternary-plots/60867/4 "2021-05-10T10:36:33Z")

</div>

Thanks! But am I missing something or there is no Julia page for Ternary plots/contours there? Sorry, I have never come across Plotly.

---

<div class="post-metadata">

**Author:** ![feanor12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feanor12/32/8212_2.png) [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Post date:** [May 10, 2021, 1:51pm UTC](https://discourse.julialang.org/t/ternary-plots/60867/5 "2021-05-10T13:51:22Z")

</div>

I just posted the documentation of the plotly framework which can be used from different languages.  
The julia binding would be the PlotlyJS.jl package.  
Here is a page about ternaries from the julia package:

[http://juliaplots.org/PlotlyJS.jl/stable/examples/ternary](http://juliaplots.org/PlotlyJS.jl/stable/examples/ternary)

---

<div class="post-metadata">

**Author:** ![Emilio\_Alvizo\_Velazq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/emilio_alvizo_velazq/32/47719_2.png) [@Emilio\_Alvizo\_Velazq](https://discourse.julialang.org/u/Emilio_Alvizo_Velazq)\
**Post date:** [March 15, 2023, 12:18pm UTC](https://discourse.julialang.org/t/ternary-plots/60867/6 "2023-03-15T12:18:17Z")

</div>

I’m sorry but I don’t think there is any way to make a ternary contour in plotly, which is a pity because in python you can do it.
