@@ -20,46 +20,54 @@ open FSharp.Plotly
2020Functional F# scripting style for Two Y-Axes
2121*)
2222
23+ (* ** define-output:twoYaxes ***)
2324[
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 );
2829]
2930|> Chart.Combine
3031|> Chart.withY_ AxisStyle( " first" , Side= StyleParam.Side.Left, Id= 1 )
3132|> 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
3335
3436
3537
3638(**
3739Functional F# scripting style for Two Y-Axes same side
3840*)
3941
42+ (* ** define-output:twoYaxesSide ***)
4043[
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 );
4548]
4649|> Chart.Combine
4750|> Chart.withX_ AxisStyle( " x-axis" , Domain=( 0.3 , 1.0 ))
4851|> Chart.withY_ AxisStyle( " first y-axis" )
4952|> 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
5355
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" ) )]
5656
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+ *)
6061
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 ***)
6371//|> Chart.Show
6472
6573
0 commit comments