-
Notifications
You must be signed in to change notification settings - Fork 81
/
4_5_splom.fsx
68 lines (48 loc) · 1.59 KB
/
4_5_splom.fsx
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
(**
---
title: Scatterplot matrix
category: Distribution Charts
categoryindex: 5
index: 5
---
*)
(*** hide ***)
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 12.0.3"
#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
(**
# Scatterplot matrix
[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx) 
[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb)
*Summary:* This example shows how to plot a scatterplot matrix (splom) in F#.
let's first create some data for the purpose of creating example charts:
*)
open Plotly.NET
let data =
[
"A",[|1.;4.;3.4;0.7;|]
"B",[|3.;1.5;1.7;2.3;|]
"C",[|2.;4.;3.1;5.|]
"D",[|4.;2.;2.;4.;|]
]
(**
Using a scatterplot matrix of several different variables can help to determine whether there are any
relationships among the variables in the dataset.
**Attention**: this function is not very well tested and does not use the `Chart.Grid` functionality.
Until that is fixed, consider creating splom plot programatically using `Chart.Grid` for more control.
*)
let splom1 =
Chart.Splom(data,Color="blue")
(*** condition: ipynb ***)
#if IPYNB
splom1
#endif // IPYNB
(***hide***)
splom1 |> GenericChart.toChartHTML
(***include-it-raw***)