You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Y-axis autorange stops working when updating the xaxes range for subplots with shared x-axes and y-axes #8053
Making a subplot figure with shared_xaxes = True, shared_yaxes=True and updating the figure to with an explicit xaxis_range resets the y-axes ranges to (-1, 4).
This only happens of both the x-axes and y-axes are shared, and only when updating the x-axes range.
It only happens if you actually have more than one row, and more than one column in the figure.
Tried with numpy inputs and plain python lists - same result.
Steps to reproduce
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig = make_subplots(rows=2, cols=2, shared_xaxes=True, shared_yaxes=True)
x = np.linspace(0, 100, 200)
y = 10 * x
fig.add_scatter(x=x, y=y, row=1, col=1)
fig.add_scatter(x=x, y=y, row=1, col=2)
fig.add_scatter(x=x, y=y, row=2, col=1)
fig.add_scatter(x=x, y=y, row=2, col=2)
fig.update_xaxes(range=(0, 100))
fig.show()
@CarlAndersson this does appear to be a bug in Plotly.js. I'll transfer the issue over to that repo so we can look at it.
In the meantime, I believe the issue is in how we detect the need to auto-set the range on the y axis when only the x axis is set. You should be able to work around this by setting the y axis behavior explicitly.
Opened #8165 for this. hasRange in constraints.handleDefaults is never reset between match groups, so once the shared x axes (with a range) are processed, the later y groups get autorange: false. That's why it needs both more than one row and more than one column: it takes two match groups to leak.
Activity
robertclaus commentedon Sep 17, 2026
@CarlAndersson this does appear to be a bug in Plotly.js. I'll transfer the issue over to that repo so we can look at it.
In the meantime, I believe the issue is in how we detect the need to auto-set the range on the y axis when only the x axis is set. You should be able to work around this by setting the y axis behavior explicitly.
CarlAndersson commentedon Sep 18, 2026
Yep, I can confirm that explicitly setting
autorange=Trueon the yaxes is a viable workaround. Thanks for the quick response!X6M-Work commentedon Nov 8, 2026
Opened #8165 for this.
hasRangeinconstraints.handleDefaultsis never reset between match groups, so once the shared x axes (with a range) are processed, the later y groups getautorange: false. That's why it needs both more than one row and more than one column: it takes two match groups to leak.