You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Implements a new distribution attribute for box plots with three options:
- normal: Standard 1.5 * IQR rule for whiskers
- log-normal: Calculates whiskers based on IQR in log units
- auto (default): Uses log-normal on log axes, normal otherwise
Prevents negative whiskers when using log scales, which would appear as
infinitely long whiskers due to log axis behavior.
Fixes#7388
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
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.The text was updated successfully, but these errors were encountered: