(** // can't yet format YamlFrontmatter (["title: Ternary line and scatter plots"; "category: Ternary Plots"; "categoryindex: 11"; "index: 1"], Some { StartLine = 2 StartColumn = 0 EndLine = 6 EndColumn = 8 }) to pynb markdown # Ternary charts [![Binder](https://plotly.net/img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath=10_0_ternary_line_scatter_plots.ipynb)  [![Script](https://plotly.net/img/badge-script.svg)](https://plotly.net/10_0_ternary_line_scatter_plots.fsx)  [![Notebook](https://plotly.net/img/badge-notebook.svg)](https://plotly.net/10_0_ternary_line_scatter_plots.ipynb) *Summary:* This example shows how to create ternary charts in F#. let's first create some data for the purpose of creating example charts: *) open Plotly.NET // a coordinates let a = [ 1; 2; 3; 4; 5; 6; 7;] // b coordinates let b = a |> List.rev //c let c = [ 2; 2; 2; 2; 2; 2; 2;] (** A Ternary plot is a barycentric plot on three variables which sum to a constant. It graphically depicts the ratios of the three variables as positions in an equilateral triangle. It is used in physical chemistry, petrology, mineralogy, metallurgy, and other physical sciences to show the compositions of systems composed of three species. In population genetics, a triangle plot of genotype frequencies is called a de Finetti diagram. In game theory, it is often called a simplex plot. Ternary plots are tools for analyzing compositional data in the three-dimensional case. ## Ternary point charts use `Chart.PointTernary` to create a ternary plot that displays points on a ternary coordinate system: *) let ternaryPoint = Chart.PointTernary(a,b,c)(* output:
*) (** ## Ternary line charts use `Chart.LineTernary` to create a ternary plot that displays a line connecting input the data on a ternary coordinate system: As values on ternary plots sum to a constant, you can omit one dimension ofd the data by providing that sum. You can also for example change the line style using `Chart.withLineStyle` *) let lineTernary = Chart.LineTernary(a,b,Sum = 10) |> Chart.withLineStyle(Color=Color.fromString "purple",Dash=StyleParam.DrawingStyle.DashDot)(* output:
*)