[BUG]: barmode="group" not working with second y axis
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- data-visualization
Research direction
Start by running the inline Python reproducer and opening the generated /tmp/trials.html to compare barmode="group" with traces on separate y axes. Trace the chart-rendering entry point responsible for bar positioning; done means the two traces render side by side rather than stacked, while preserving their secondary-axis settings and error bars.
Written by the indexing model from the issue text.
Description
import plotly.graph_objects as go
def bar_chart_with_error_bars():
# Trace C
trace_c = go.Bar(
x=["Trial 1", "Trial 2", "Trial 3"],
y=[3, 6, 4],
name="Trace C",
error_y=dict(
type="data",
array=[1, 0.5, 1.5]
)
)
# Trace E (secondary y-axis)
trace_e = go.Bar(
x=["Trial 1", "Trial 2", "Trial 3"],
y=[400, 700, 300],
name="Trace E",
yaxis="y2",
error_y=dict(
type="data",
array=[50, 100, 200]
)
)
# Layout
layout = go.Layout(
barmode="group",
yaxis=dict(title="Trace C"),
yaxis2=dict(
title="Trace E",
overlaying="y",
side="right"
)
)
# Create figure
fig = go.Figure(data=[trace_c, trace_e], layout=layout)
# Save to HTML
fig.write_html("/tmp/trials.html")
# Call the function
bar_chart_with_error_bars()
Resulting chart. Stack instead of group.
rust version is also broken, but in different way - overlay instead of group: https://github.com/plotly/plotly.rs/issues/391
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plotly/plotly.py
-
P3 size: 1 task
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug P1
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
feature P3
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
feature P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in plotly/plotly.py
Similar issues
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100