-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Description
Currently, Plotly's go.Box and go.Violin calculate Q1 and Q3 using Method #10 (Langford) when quartilemethod is set to "linear". However, the industry standard for data analysis in Python (Pandas and NumPy's default method="linear") follows Method #7.
This discrepancy creates a significant issue when users try to align Plotly's hover information with custom annotations or static tables calculated via Pandas. Even with the same "linear" naming, the resulting values (e.g., 4950.5 vs 4931.75) do not match, leading to confusion in professional reporting and automated screenshots.
I would like to request an additional option for the quartilemethod attribute (e.g., "standard" or "method7") that aligns with the default interpolation used in Pandas and NumPy (method="linear" / Type 7).
Why should this feature be added?
Consistency: Many users calculate summary statistics using Pandas before plotting. Having to manually inject q1, q3, and median as lists for every single trace just to match the hover data is highly inefficient.
Reproducibility: It is difficult to replicate Plotly’s internal Method #10 logic in external scripts without specific statistical knowledge, whereas Method #7 is the global default in the Python ecosystem.
User Experience: When creating dashboards that require fixed annotations alongside box plots, the numerical mismatch makes the visualization appear inaccurate to end-users.
Mocks/Designs
Please add any mocks or designs you might have for the feature.
Notes
Additional Context
According to the current documentation, Plotly uses Method #10 (from http://jse.amstat.org/v14n3/langford.html). Adding support for the more common Method #7 would greatly enhance the library's compatibility with the broader Python data science stack.