Plotly.NET
Plotly.NET copied to clipboard
'NaN' disturbs axis format
Description
When i want to create Boxplots of float arrays and combine them, i run into an issue if one or more of the arrays consist of 'NaN'. With the NaNs in the array the axis seems to be treated as a category axis and not as a value axis, leading to a non-continuously labeled axis.
Repro steps
-
Open a fsx file and load FShar.Plotly
-
Run the following snippet:
let testArr =
[|
(1, [|nan;nan;nan|]);
(2, [|0.07427533383; 0.757004965; 0.6258709596|]);
(3, [|0.2661355688; 0.7138485368; 0.3500703892|])
|]
testArr
|> Array.map (fun (number, values) ->
Chart.BoxPlot ("y",values, Name=(sprintf "N: %i" number),Boxpoints=StyleParam.Boxpoints.All,Orientation=StyleParam.Orientation.Vertical)
)
|> Chart.Combine
|> Chart.withMargin (Margin.init(Left=200.))
|> Chart.Show
Known workarounds
Filter all arrays and remove every NaN present