secondary_y creates a small spacing on the right
Open
Nobody has claimed this yet.
bug
P3
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
It looks like secondary_y would cause the chart to render a small chunk of whitespace to the right of it.
With secondary_y:

import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots(specs=[[{'secondary_y': True}]])
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[40, 50, 60], name='yaxis data'), secondary_y=False)
fig.add_trace(go.Scatter(x=[2, 3, 4], y=[4, 5, 6], name='yaxis2 data'), secondary_y=True)
fig.update_layout(legend={'y': 1, 'x': 0}, margin={'t': 0, 'b': 0, 'l': 0, 'r': 0})
fig.show()
Without secondary_y:

import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots()
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[40, 50, 60], name='yaxis data'))
fig.add_trace(go.Scatter(x=[2, 3, 4], y=[4, 5, 6], name='yaxis2 data'))
fig.update_layout(legend={'y': 1, 'x': 0}, margin={'t': 0, 'b': 0, 'l': 0, 'r': 0})
fig.show()
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.
Research direction
Start by running the two Plotly Python examples in the issue and compare the rendered chart widths with and without secondary_y. Trace the subplot and layout handling involved in secondary_y; done means the extra right-side whitespace is gone while both y-axes and the displayed traces remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- plotly, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100