@@ -20,46 +20,54 @@ open FSharp.Plotly
20
20
Functional F# scripting style for Two Y-Axes
21
21
*)
22
22
23
+ (* ** define-output:twoYaxes ***)
23
24
[
24
- Chart.Scatter ([ 1 ; 2 ; 3 ; 4 ],[ 12 ; 9 ; 15 ; 12 ], StyleParam.Mode.Lines_ Markers, Name= " anchor 1" )
25
- |> Chart.withAxisAnchor( Y= 1 );
26
- Chart.Line([ 1 ; 2 ; 3 ; 4 ],[ 90 ; 110 ; 190 ; 120 ], Name= " anchor 2" )
27
- |> Chart.withAxisAnchor( Y= 2 );
25
+ Chart.Scatter ([ 1 ; 2 ; 3 ; 4 ],[ 12 ; 9 ; 15 ; 12 ], StyleParam.Mode.Lines_ Markers, Name= " anchor 1" )
26
+ |> Chart.withAxisAnchor( Y= 1 );
27
+ Chart.Line([ 1 ; 2 ; 3 ; 4 ],[ 90 ; 110 ; 190 ; 120 ], Name= " anchor 2" )
28
+ |> Chart.withAxisAnchor( Y= 2 );
28
29
]
29
30
|> Chart.Combine
30
31
|> Chart.withY_ AxisStyle( " first" , Side= StyleParam.Side.Left, Id= 1 )
31
32
|> Chart.withY_ AxisStyle( " second" , Side= StyleParam.Side.Right, Id= 2 , Overlaying= StyleParam.AxisAnchorId.Y 1 )
32
- |> Chart.Show
33
+ (* ** include-it:twoYaxes ***)
34
+ //|> Chart.Show
33
35
34
36
35
37
36
38
(**
37
39
Functional F# scripting style for Two Y-Axes same side
38
40
*)
39
41
42
+ (* ** define-output:twoYaxesSide ***)
40
43
[
41
- Chart.Scatter ([ 1 ; 2 ; 3 ; 4 ],[ 12 ; 9 ; 15 ; 12 ], StyleParam.Mode.Lines_ Markers, Name= " anchor 1" )
42
- |> Chart.withAxisAnchor( Y= 1 );
43
- Chart.Line([ 1 ; 2 ; 3 ; 4 ],[ 90 ; 110 ; 190 ; 120 ], Name= " anchor 2" )
44
- |> Chart.withAxisAnchor( Y= 2 );
44
+ Chart.Scatter ([ 1 ; 2 ; 3 ; 4 ],[ 12 ; 9 ; 15 ; 12 ], StyleParam.Mode.Lines_ Markers, Name= " anchor 1" )
45
+ |> Chart.withAxisAnchor( Y= 1 );
46
+ Chart.Line([ 1 ; 2 ; 3 ; 4 ],[ 90 ; 110 ; 190 ; 120 ], Name= " anchor 2" )
47
+ |> Chart.withAxisAnchor( Y= 2 );
45
48
]
46
49
|> Chart.Combine
47
50
|> Chart.withX_ AxisStyle( " x-axis" , Domain=( 0.3 , 1.0 ))
48
51
|> Chart.withY_ AxisStyle( " first y-axis" )
49
52
|> Chart.withY_ AxisStyle( " second y-axis" , Side= StyleParam.Side.Left, Id= 2 , Overlaying= StyleParam.AxisAnchorId.Y 1 , Position= 0.15 , Anchor= StyleParam.AxisAnchorId.Free)
50
- |> Chart.Show
51
-
52
-
53
+ (* ** include-it:twoYaxesSide ***)
54
+ //|> Chart.Show
53
55
54
- // Simple Subplot
55
- [ for i= 1 to 8 do yield ( Chart.Scatter ([ 1 ; 2 ; 3 ; 4 ],[ 12 ; 9 ; 15 ; 12 ], StyleParam.Mode.Lines_ Markers) |> Chart.withY_ AxisStyle( " y-title" ) )]
56
56
57
- |> Chart.stackHorizontal( Col= 2 , Space= 0.15 )
58
- |> Chart.Combine
59
- |> Chart.Show
57
+ (**
58
+ Functional F# scripting style simple subplot stacked 2 columns.
59
+ Axis style (like: title) is taken from the single chart, but can also be styled by axis id.
60
+ *)
60
61
61
- //|> Chart.withX_AxisStyle("Title1")
62
- //|> Chart.withX_AxisStyle(sprintf "Title%i" 3,Id=3)
62
+ (* ** define-output:stack ***)
63
+ [
64
+ for i= 1 to 8 do
65
+ yield Chart.Scatter ([ 1 ; 2 ; 3 ; 4 ],[ 12 ; 9 ; 15 ; 12 ], StyleParam.Mode.Lines_ Markers)
66
+ |> Chart.withY_ AxisStyle( sprintf " y-title %i " i)
67
+ ]
68
+ |> Chart.Stack( Columns= 2 , Space= 0.15 )
69
+ |> Chart.withX_ AxisStyle( sprintf " x-title %i " 3 , Id= 3 )
70
+ (* ** include-it:stack ***)
63
71
//|> Chart.Show
64
72
65
73
0 commit comments