Y axis ticks too precise

I’m not sure if this is a bug.

I have subplots generated with “plotly.subplots.make_subplots”, and in a special case I get too precise tick labels.

And it overlaps the text that I put on the left side of the plots.


If I zoom in a bit, the plot looks ok.


Also if I have a single plot with all the rest of the lineplots, but only show this by clicking on the legend, the resulting ticklables are reasonable.

I know that I can put a condition to check for such cases and change the range accordingly, but I felt that this might be a bug. If needed, I can provide access to the application too.

My gut reaction here is your data may have almost all points at one value, but one or a few points that differ from that value by a tiny amount. I don’t see the full plot to know if that’s the case, but that’s the only reason I can think of for the blue line to be up at the top of the subplot with a very small range to the plot - is there a point down at the bottom of the subplot that you cut off with your screenshot?

Then when you zoom in, you’re presumably only getting a single value for the blue trace, and when we see that there’s nothing to scale the autorange so we default to that value ±1, in this case ~-7.3 to -9.3

You could try rounding your data a little bit, so these tiny differences don’t show up at all; or, depending on the nature of the data, set for example rangemode: 'tozero' on that y axis will force a larger range.


I have reduced some precision from the points and that solves the issue.