Skip to content

Commit 9a4a1ca

Browse files
muehlmuehl
authored andcommitted
Fix: withAxis
1 parent 7aef9ac commit 9a4a1ca

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

docs/content/box-plots.fsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
1919
let x = ["bin1";"bin2";"bin1";"bin2";"bin1";"bin2";"bin1";"bin1";"bin2";"bin1"]
2020

2121
(*** define-output:box1 ***)
22-
Chart.BoxPlot(x,y,Jitter=0.1,Boxpoints=StyleOption.Boxpoints.All)
22+
Chart.BoxPlot(x,y,Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All)
2323
(*** include-it:box1 ***)
24-
24+
|> Chart.Show
2525
(**
2626
By swapping x and y plus using `StyleOption.Orientation.Horizontal` we can flip the chart horizontaly.
2727
*)
2828
(*** define-output:box2 ***)
29-
Chart.BoxPlot(y,x,Jitter=0.1,Boxpoints=StyleOption.Boxpoints.All,Orientation=StyleOption.Orientation.Horizontal)
29+
Chart.BoxPlot(y,x,Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All,Orientation=StyleParam.Orientation.Horizontal)
3030
(*** include-it:box2 ***)
31-
31+
|> Chart.Show
3232

3333

3434
(**
@@ -39,9 +39,9 @@ let y' = [2.; 1.5; 5.; 1.5; 2.; 2.5; 2.1; 2.5; 1.5; 1.;2.; 1.5; 5.; 1.5; 3.; 2.
3939

4040
(*** define-output:box3 ***)
4141
[
42-
Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,Boxpoints=StyleOption.Boxpoints.All);
43-
Chart.BoxPlot("y'",y',Name="bin2",Jitter=0.1,Boxpoints=StyleOption.Boxpoints.All);
42+
Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All);
43+
Chart.BoxPlot("y'",y',Name="bin2",Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All,Color="ligthgrey");
4444
]
4545
|> Chart.Combine
4646
(*** include-it:box3 ***)
47-
47+
|> Chart.Show

src/FSharp.Plotly/Chart.fs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,19 @@ type Chart =
287287

288288

289289
/// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum.
290-
static member BoxPlot(?x,?y,?Name,?Showlegend,?Color,?Opacity,?Whiskerwidth,?Boxpoints,?Boxmean,?Jitter,?Pointpos,?Orientation) =
290+
static member BoxPlot(?x,?y,?Name,?Showlegend,?Color,?Fillcolor,?Opacity,?Whiskerwidth,?Boxpoints,?Boxmean,?Jitter,?Pointpos,?Orientation) =
291291
Trace.initBoxPlot (TraceStyle.BoxPlot(?X=x, ?Y = y,
292292
?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,
293-
?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation,?Fillcolor=Color) )
293+
?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation,?Fillcolor=Fillcolor) )
294294
|> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity)
295+
|> TraceStyle.Marker(?Color=Color)
295296
|> GenericChart.ofTraceObject
296297

297298

298299
/// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum.
299-
static member BoxPlot(xy,?Name,?Showlegend,?Color,?Opacity,?Whiskerwidth,?Boxpoints,?Boxmean,?Jitter,?Pointpos,?Orientation) =
300+
static member BoxPlot(xy,?Name,?Showlegend,?Color,?Fillcolor,?Opacity,?Whiskerwidth,?Boxpoints,?Boxmean,?Jitter,?Pointpos,?Orientation) =
300301
let x,y = Seq.unzip xy
301-
Chart.BoxPlot(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation)
302+
Chart.BoxPlot(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation)
302303

303304

304305
/// Shows a graphical representation of a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format.

src/FSharp.Plotly/ChartExtensions.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ module ChartExtensions =
104104

105105

106106
// Sets x-Axis of 2d and 3d- Charts
107-
static member withX_AxisStyle(title,?MinMax,?Showgrid) =
107+
static member withX_AxisStyle(title,?MinMax,?Showgrid,?Showline) =
108108
let range = if MinMax.IsSome then Some (StyleParam.RangeValues.MinMax (MinMax.Value)) else None
109-
let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid)
109+
let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline)
110110
Chart.withX_Axis(xaxis)
111111

112112

@@ -134,9 +134,9 @@ module ChartExtensions =
134134
)
135135

136136
// Sets y-Axis of 3d- Charts
137-
static member withY_AxisStyle(title,?MinMax,?Showgrid) =
137+
static member withY_AxisStyle(title,?MinMax,?Showgrid,?Showline) =
138138
let range = if MinMax.IsSome then Some (StyleParam.RangeValues.MinMax (MinMax.Value)) else None
139-
let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid)
139+
let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline)
140140
Chart.withY_Axis(yaxis)
141141

142142

0 commit comments

Comments
 (0)