Skip to content

Box plots with log-scaled whiskers #7388

Open
@alexcjohnson

Description

@alexcjohnson

The standard formula we use for the length of box plot whiskers is 1.5 * IQR (interquartile range, ie the third quartile minus the first quartile). This is based on comparing your distribution to a normal distribution, where any data beyond those whiskers is considered an outlier. However, if you're displaying your data on a log scale (and sometimes even if you're not) a log-normal distribution is likely more appropriate, in which case the whisker locations should be calculated based on the IQR in log units. This brings both fences up, in particular preventing the lower fence from ever going negative ie an infinitely long whisker on a log scale.

I'd propose a new attribute for box traces, something like distribution: 'normal' | 'log-normal' | 'auto' where 'auto' uses 'log-normal' when displayed on a log axis, otherwise 'normal'. I'll be happy to submit a PR to add this functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions