(** // can't yet format YamlFrontmatter (["title: Carpet line and scatter plots"; "category: Carpet Plots"; "categoryindex: 12"; "index: 1"], Some { StartLine = 2 StartColumn = 0 EndLine = 6 EndColumn = 8 }) to pynb markdown # Carpet charts [![Binder](https://plotly.net/img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath=11_1_carpet_line_scatter_plots.ipynb)  [![Script](https://plotly.net/img/badge-script.svg)](https://plotly.net/11_1_carpet_line_scatter_plots.fsx)  [![Notebook](https://plotly.net/img/badge-notebook.svg)](https://plotly.net/11_1_carpet_line_scatter_plots.ipynb) *Summary:* This example shows how to create carpet charts in F#. let's first create some data for the purpose of creating example charts: *) open Plotly.NET //carpet coordinate data let a = [4.; 4.; 4.; 4.5; 4.5; 4.5; 5.; 5.; 5.; 6.; 6.; 6.] let b = [1.; 2.; 3.; 1.; 2.; 3.; 1.; 2.; 3.; 1.; 2.; 3.] let y = [2.; 3.5; 4.; 3.; 4.5; 5.; 5.5; 6.5; 7.5; 8.; 8.5; 10.] //carpet plot data let aData = [4.; 5.; 5.; 6.] let bData = [1.; 1.; 2.; 3.] let sizes = [5; 10; 15; 20] (** A carpet plot is any of a few different specific types of plot. The more common plot referred to as a carpet plot is one that illustrates the interaction between two or more independent variables and one or more dependent variables in a two-dimensional plot. Besides the ability to incorporate more variables, another feature that distinguishes a carpet plot from an equivalent contour plot or 3D surface plot is that a carpet plot can be used to more accurately interpolate data points. A conventional carpet plot can capture the interaction of up to three independent variables and three dependent variables and still be easily read and interpolated. Carpet plots have common applications within areas such as material science for showing elastic modulus in laminates,and within aeronautics. A carpet plot with two independent variables and one dependent variable is often called a cheater plot for the use of a phantom "cheater" axis instead of the horizontal axis. (https://en.wikipedia.org/wiki/Carpet_plot) ## Carpet Traces In plotly, carpet plots are different to all other trace types in the regard that the coordinate system of the carpet is not set on the layout, but is itself a trace. Use `Chart.Carpet` to define these `coordinate traces`. All carpets have a mandatory identifier, which will be used by other traces to define which carpet coordinate system to use. *) let carpet = Chart.Carpet("carpetIdentifier", A = a, B = b, Y = y)(* output:
*) (** ## Carpet point charts use `Chart.PointCarpet` to create a point plot on the referenced carpet coordinate system: *) let carpetPoint = [ carpet Chart.PointCarpet(aData,bData,"carpetIdentifier", Name = "Point") ] |> Chart.combine(* output:
*) (** ## Carpet line charts use `Chart.LineCarpet` to create a line plot on the referenced carpet coordinate system: *) let carpetLine = [ carpet Chart.LineCarpet(aData,bData,"carpetIdentifier",Name = "Line") ] |> Chart.combine(* output:
*) (** ## Carpet Spline charts use `Chart.LineCarpet` to create a spline plot on the referenced carpet coordinate system: *) let carpetSpline = [ carpet Chart.SplineCarpet(aData,bData,"carpetIdentifier",Name = "Spline") ] |> Chart.combine(* output:
*) (** ## Carpet bubble charts use `Chart.LineCarpet` to create a bubble plot on the referenced carpet coordinate system: *) let carpetBubble = [ carpet Chart.BubbleCarpet((Seq.zip3 aData bData sizes),"carpetIdentifier",Name = "Bubble") ] |> Chart.combine(* output:
*)