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()