Skip to content

[BUG]: Y-axis autorange stops working when updating the xaxes range for subplots with shared x-axes and y-axes #8053

Description

@CarlAndersson

Description

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()

Activity

  1. robertclaus commented on Sep 17, 2026

    @robertclaus

    @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.

    fig.update_xaxes(range=(0, 100))
    fig.update_yaxes(autorange=True)
    
  2. CarlAndersson commented on Sep 18, 2026

    @CarlAndersson
    Author

    Yep, I can confirm that explicitly setting autorange=True on the yaxes is a viable workaround. Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething brokensize: 1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions