Scatter plot pan is causing zoom

I have just created a scatter plot which contains some data of which the x and y values are very small (or big) to eachother. The pan movement is causing the xaxis range to be set to the one of the yaxis. How can I prevent this from happening?

An example can be seen here.

I am using the following data and layout objects:

  data: [{
    name: name,
    x: x,
    y: y,
    mode: 'lines',
    type: 'scatter'
  }],
  layout: {
    title: {
      text: 'Plot Title',
    },
  xaxis (also yaxis): {
    title: {
      text: '',
    },
    showgrid: false,
    zeroline: true,
    showline: true,
    showticklabels: true,
    ticks: 'outside',
    mirror: 'ticks'
  },
    autosize: true
 }

The variables (x etc) are set by data fetched from a database.

Thanks for writing in. Can you share the data and layout attributes you used to generate your graph?

I have edited my original post to add them.

I can’t reproduce the problem in a codepen: https://codepen.io/etpinard/pen/aboXmNd

Can you?

Turns out I made some stupid mistake, I initialized the object by setting the axis properties equal to the same axis object that I defined earlier. Since I did not create a copy of them myself, transforming the graph caused them to get the same values. Thanks for your help nonetheless.

1 Like