Skip to content

[BUG]: Range slider y-axis "fixed" rangemode renders unexpected thick horizontal bars on initial load #5614

Description

@smith2936

Description

When initializing a Plotly chart with an xaxis range slider that has its yaxis.rangemode set to "fixed", the chart initially renders two extra, thick, solid gray horizontal bars stretching across the entire width of the range slider track.

However, this appears to be a visual artifact or initialization bug: if you dynamically toggle the rangemode to "auto" or "match" (via an updatemenu dropdown) and then switch it back to "fixed", the gray bars disappear entirely, and the range slider track displays normally as expected.

Screenshots/Video

Initial render (Buggy):

Image

After toggling to "Auto"/"Match" and back to "Fixed" (Expected):

Image

Steps to reproduce

  1. Run the provided Python script to generate the Plotly figure.
  2. Observe the range slider at the bottom of the chart upon initial rendering. Note the unexpected thick gray horizontal bars spanning the slider track.
  3. Use the dropdown menu in the top-left corner to select "Rangemode: Auto/Match".
  4. Use the dropdown menu again to select "Rangemode: Fixed".
  5. Observe that the range slider now looks correct and the gray bars have vanished.
import plotly; print(plotly.__version__) # 6.8.0
import pandas as pd

pd.options.plotting.backend = "plotly"

df = pd.DataFrame(dict(a=[1, 3, 2], b=[3, 2, 1]))
fig = df.plot.line()

fig.update_layout(xaxis=dict(rangeslider=dict(visible=True, yaxis=dict(rangemode="fixed"))))

fig.update_layout(
    updatemenus=[
        dict(
            type="dropdown",
            active=1,
            buttons=[
                dict(
                    label="Rangemode: Auto",
                    method="relayout",
                    args=[{"xaxis.rangeslider.yaxis.rangemode": "auto"}],
                ),
                dict(
                    label="Rangemode: Fixed",
                    method="relayout",
                    args=[{"xaxis.rangeslider.yaxis.rangemode": "fixed"}],
                ),
                dict(
                    label="Rangemode: match",
                    method="relayout",
                    args=[{"xaxis.rangeslider.yaxis.rangemode": "match"}],
                ),
            ],
        )
    ]
)

fig.show()

Notes

  • Environment: Verified using plotly version 6.8.0 alongside pandas plotting backend.
  • This behavior suggests a missing or improper initialization redraw when rangemode="fixed" is passed via the initial layout configuration, which is subsequently corrected whenever relayout triggers a fresh calculation of the range slider boundaries.

Activity

  1. changed the title [-][BUG]: Range slider y-axis "fixed" rangemode renders unexpected thick horizontal bars on initial load[/-] [+][BUG]: Range slider x-axis "fixed" rangemode renders unexpected thick horizontal bars on initial load[/+] on Jun 5, 2026
  2. changed the title [-][BUG]: Range slider x-axis "fixed" rangemode renders unexpected thick horizontal bars on initial load[/-] [+][BUG]: Range slider y-axis "fixed" rangemode renders unexpected thick horizontal bars on initial load[/+] on Jun 5, 2026
  3. robertclaus commented on Jun 17, 2026

    @robertclaus

    Thank you for reporting this issue. We investigated and think this might be a simple fix in plotly.py or plotly.js that is easy to reproduce and test. Please feel free to open a PR if you're comfortable investigating!

  4. arun-pandian-p commented on Jul 11, 2026

    @arun-pandian-p

    Hi! I'd like to work on this if it's still available.

    I can reproduce the bug with the provided script on plotly 6.8.0.

    My investigation plan:

    1. Confirm the bug is triggered only when rangemode="fixed" is set
      in the initial layout (not via relayout)
    2. Check if explicitly providing yaxis.range alongside rangemode
      prevents the gray bars
    3. Trace whether the fix belongs in plotly.py's layout initialization
      or needs to be flagged upstream to plotly.js

    Will update here with findings before opening a PR.

  5. Guhapriya01 commented on Aug 16, 2026

    @Guhapriya01

    Hi! I'm looking into this issue too - happy to help investigate if it's still open. @arun-pandian-p, are you still working on this, or is it up for grabs?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions