Skip to content

boxplots with q1/median/q3 signature always show fences as min/max on hover #6212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hafen opened this issue Jun 8, 2022 · 2 comments
Open
Labels
bug something broken P3 backlog

Comments

@hafen
Copy link

hafen commented Jun 8, 2022

Like many who requested the boxplot with q1/median/q3 signature, I have a situation where I am pre-computing these statistics (along with lower and upper fence) from a very large database and then feeding these values to plotly.

I am also pre-computing outliers and adding those as a separate trace.

When using the boxplot with q1/median/q3 signature, we do not have the flexibility to label the fences correctly in the case of outliers.

See the example below (codepen):

image

Here there are no low outliers, so the lower fence is correctly labeled as "min" in the hover. However, the upper fence is labeled as "max" even though there are outliers.

This is confusing to users who wonder why something is labeled as the max when there are points outside of the fence. If I chose not to add the outliers trace, which is probably what most people do who are using this boxplot signature, it would be even more misleading because there would be no hint about whether the underlying data these fences were computed from really have min and max values at the fences, which could lead to some incorrect and bad conclusions about the data.

Fences are not necessarily the min and max, and when using the q1/median/q3 signature, the boxplot has no way of knowing which is the case.

This could be addressed with any of the following:

  1. Allow the ability to override the hover text for this signature
  2. Add an outliers argument to this signature as some have proposed here
  3. Add min/max to the signature – these wouldn't be plotted, but if min < lowerfence, then the hover text for lowerfence would be "lowerfence" (otherwise "min") and similar logic for upperfence/max
  4. Always make the hover text for the lower and upper fences as "lowerfence" and "upperfence" regardless of whether they represent the min/max
  5. Remove the boxplot with q1/median/q3 signature option because it produces a plot that currently by default has statistically incorrect hover info

Personally I lean toward (3).

@cthanh2310
Copy link

cthanh2310 commented Jun 19, 2023

do you know the way to hide id when hovering?

@LittleLama
Copy link

I agree with #3

@gvwilson gvwilson self-assigned this Jul 12, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added bug something broken P3 backlog labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

4 participants