Skip to content

'NaN' disturbs axis format #46

@caroott

Description

@caroott

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.

image

Repro steps

  1. Open a fsx file and load FShar.Plotly

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions