Plotly.js: Boxplot: Set Whisker options

Created on 24 Feb 2016  Â·  10Comments  Â·  Source: plotly/plotly.js

Problem: Boxplot Whiskers can map to different data – sometimes this is +- 1.5 times the interquartil range, sometime the 5th and 95th percentile etc. In the box documentation, it is state that plotly uses the +-1.5 IQR as a standard. It is also stated that the _boxpoints_ option allows other options, but seemingly _boxpoints_ sets the displaying sof catterpoint and not of whiskers.

Proposed Solution: An option for setting what the whiskers mean. Candidates for this option would:

  • n * IQR (for a +-1.5* the IQR, like the current default)
  • nth percentiles (for something like a 5%/95% position)
  • n*sd (for a +- 1 standard deviation position)

Or, if that option(s) already exists, a hint in the docuementation on how to set them.

feature ♥ NEEDS SPON$OR

Most helpful comment

Any updates on this in 2019? Having the whiskers mean one thing in some graphs (where the boxpoints are visible) and another in others (where the boxpoints are not visible) is somewhat confusing.

All 10 comments

Thanks for the very clear description :beers:

You are correct. There is no way to override the box trace whisker metric at the moment.

Adding whiskers option is a great suggestion!

Unfortunately, because of other obligations, no plotly.js team member will dedicate time to this enhancement until at least April 1st.

That said, this issue could be a great way for someone from the community to make a PR. All the action will take place in src/traces/box/ starting by adding a trace attribute in src/traces/box/attributes.js then coercing it in the default step src/traces/box/defaults.js and finally generalizing the calc step in src/traces/box/calc.js.

:beers: cheers!
Thanks for pointing out the relevant files. I see what I can do but can't promise that I'm quicker than April the 1st :-)

@etpinard @jdittrich is this still unresolved?

@Alanocallaghan sadly not, I was unable to tackle it.

see also #1953 - one of the options should be max/min (which I guess would count as 0/100th percentile?) - and then rather than the current hard-coded dependence on boxpoints, boxpoints should just affect the default value of this setting.

Any updates on this in 2019? Having the whiskers mean one thing in some graphs (where the boxpoints are visible) and another in others (where the boxpoints are not visible) is somewhat confusing.

Agreed. Whiskers should correspond to editable percentile. That's how matplotlib does it.

Any update on this issue?

Seems like an old issue but keeps on coming back. I was a bit thrown off when I set boxpoints=False but suddenly my whiskers extended to cover all the outliers and the entire plot changed. This is for plotly.py.

Screenshot from 2020-07-13 20-14-07

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $5k-$10k

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

Was this page helpful?
0 / 5 - 0 ratings