plotly / plotly/plotly.py

Sided twin violins render boxplot whiskers incorrectly

Open
#5,323 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Plotly version: 6.3.0

Follow-up to #1634 (never resolved).

When using sided (split) violins with box=dict(visible=True), the boxplot whiskers are drawn at the inner edge of each half-box, rather than being centered as in a normal boxplot.

This makes the left and right whiskers appear extremely close together, which creates significant visual confusion.

Example from #1634 (Advanced Violin Plot example with box=dict(visible=True)):
Image

My reproduction:
Image

Normal (non-sided) violins for comparison:
Image

Plotly 6.1.2 (in my work):
Image

Possible cause:
The boxplots may be internally split in half to fit each half-violin, shifting the “center” used for whisker rendering to the midpoint between the halves.

Possible solutions:

  • Preferred: Render each half-boxplot with whiskers centered over its own half-violin.
  • Alternative: Allow configurable spacing between the halves to reduce whisker overlap.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the sided-violin example from the Advanced Violin Plot with box=dict(visible=True), then compare it with a normal violin and Plotly 6.1.2 while tracing the rendering path for split boxes. Done means the whiskers are centered correctly for each half without regressing normal violins.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.