From 0ce6106ee1d3175215acd25f8739d4df3334debc Mon Sep 17 00:00:00 2001
From: Alejandro Moreo <alejandro.moreo@isti.cnr.it>
Date: Fri, 21 Jul 2023 12:56:01 +0200
Subject: [PATCH] simplex plot

---
 laboratory/simplex_density_plot.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 laboratory/simplex_density_plot.py

diff --git a/laboratory/simplex_density_plot.py b/laboratory/simplex_density_plot.py
new file mode 100644
index 0000000..576d5ab
--- /dev/null
+++ b/laboratory/simplex_density_plot.py
@@ -0,0 +1,13 @@
+import plotly.figure_factory as ff
+
+import numpy as np
+Al = np.array([0. , 0. , 0., 0., 1./3, 1./3, 1./3, 2./3, 2./3, 1.])
+Cu = np.array([0., 1./3, 2./3, 1., 0., 1./3, 2./3, 0., 1./3, 0.])
+Y = 1 - Al - Cu
+# synthetic data for mixing enthalpy
+# See https://pycalphad.org/docs/latest/examples/TernaryExamples.html
+enthalpy = (Al - 0.01) * Cu * (Al - 0.52) * (Cu - 0.48) * (Y - 1)**2
+fig = ff.create_ternary_contour(np.array([Al, Y, Cu]), enthalpy,
+                                pole_labels=['Al', 'Y', 'Cu'],
+                                interp_mode='cartesian')
+fig.show()