Skip to content

zoom broken with multiple traces with different zorder #7320

Open

Description

@mrubioroy

When I set different zorder to two traces in the same axes. After zooming and reseting axes, zoom no longer works as expected.
Steps to reproduce:

  • Open this example
  • Zoom between x=3 and x=4 => works as expected
  • Reset axes
  • Zoom between x=1 and x=2 => zoomed region is not between 1 and 2 as expected

Am I using zorder incorrectly or is this a bug?

Example:

JS:

var trace1 = {x0: 1, dx: 1, y: [10, 15, 13, 17], zorder: 0};
var trace2 = {x0: 1, dx: 1, y: [16, 5, 11, 9], zorder: 1};
var data = [trace1, trace2];
Plotly.newPlot('myDiv', data);

HTML:

<head>
	<script src='https://cdn.plot.ly/plotly-2.35.2.min.js'></script>
</head>
<body>
	<div id='myDiv'></div>
</body>

Activity

  1. camdecoster commented on Oct 29, 2026

    @camdecoster
    Contributor

    I've run into (I think) the same issue while working on #8065. Here's the repro snippet that can be used in Plotly devtools:

    const x = [...Array(12).keys()], y = x.map(i => i % 3);
    Plotly.newPlot(gd, [
      { x, y, mode: 'markers', zorder: 0 },
      { x: x.map(i => i + 0.15), y: y.map(v => v + 0.12), mode: 'markers', zorder: 1 }
    ], { dragmode: 'pan' });

    In my case, I'm seeing pan breaking after using 'Reset axes', but it looks like zooming isn't working properly either.

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