-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy path11_2_contourcarpet_plots.fsx
More file actions
74 lines (63 loc) · 2.08 KB
/
Copy path11_2_contourcarpet_plots.fsx
File metadata and controls
74 lines (63 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
(**
---
title: Contour carpet plots
category: Carpet Plots
categoryindex: 12
index: 2
---
*)
(*** hide ***)
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 12.0.3"
#r "nuget: DynamicObj"
#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
(*** condition: ipynb ***)
#if IPYNB
#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
#endif // IPYNB
(**
# Contour carpet charts
[](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb) 
[]({{root}}{{fsdocs-source-basename}}.fsx) 
[]({{root}}{{fsdocs-source-basename}}.ipynb)
*Summary:* This example shows how to create contour plots on carpets in F#.
*)
open Plotly.NET
open Plotly.NET.LayoutObjects
let contourCarpet =
[
Chart.Carpet(
"contour",
A = [0.; 1.; 2.; 3.; 0.; 1.; 2.; 3.; 0.; 1.; 2.; 3.],
B = [4.; 4.; 4.; 4.; 5.; 5.; 5.; 5.; 6.; 6.; 6.; 6.],
X = [2.; 3.; 4.; 5.; 2.2; 3.1; 4.1; 5.1; 1.5; 2.5; 3.5; 4.5],
Y = [1.; 1.4; 1.6; 1.75; 2.; 2.5; 2.7; 2.75; 3.; 3.5; 3.7; 3.75],
AAxis = LinearAxis.initCarpet(
TickPrefix = "a = ",
Smoothing = 0.,
MinorGridCount = 9,
AxisType = StyleParam.AxisType.Linear
),
BAxis = LinearAxis.initCarpet(
TickPrefix = "b = ",
Smoothing = 0.,
MinorGridCount = 9,
AxisType = StyleParam.AxisType.Linear
)
)
Chart.ContourCarpet(
"contour",
[1.; 1.96; 2.56; 3.0625; 4.; 5.0625; 1.; 7.5625; 9.; 12.25; 15.21; 14.0625],
A = [0; 1; 2; 3; 0; 1; 2; 3; 0; 1; 2; 3],
B = [4; 4; 4; 4; 5; 5; 5; 5; 6; 6; 6; 6]
)
]
|> Chart.combine
(*** condition: ipynb ***)
#if IPYNB
contourCarpet
#endif // IPYNB
(***hide***)
contourCarpet |> GenericChart.toChartHTML
(***include-it-raw***)