plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

plotly 6.1.2.violinmode='group' does not work

Open junjiecai opened this issue 7 months ago • 0 comments

(Environment): Plotly Version: 6.1.2 Python Version: 3.13.2 Operating System: macOS (Seqonia 15.2)

When using the violinmode='group', it just behave like violinmode='overlay'

Code to reproduce, just use the grouped violin plot example from official documentation

mport plotly.graph_objects as go

import pandas as pd

df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv")

fig = go.Figure()

fig.add_trace(go.Violin(x=df['day'][ df['sex'] == 'Male' ],
                        y=df['total_bill'][ df['sex'] == 'Male' ],
                        legendgroup='M', scalegroup='M', name='M',
                        line_color='blue')
             )
fig.add_trace(go.Violin(x=df['day'][ df['sex'] == 'Female' ],
                        y=df['total_bill'][ df['sex'] == 'Female' ],
                        legendgroup='F', scalegroup='F', name='F',
                        line_color='orange')
             )

fig.update_traces(box_visible=True, meanline_visible=True)
fig.update_layout(violinmode='group')
fig.show()

Expected Behavior:

Image

Actual Behavior: In 6.1.2, "group" give the same result with "overlay"

Image

Additional Notes: After I downgrade to 6.0.1, the same code works fine

junjiecai avatar Jun 06 '25 14:06 junjiecai