I was plotting two different linear series on Y1 and Y2. When I zoomed in on a small area then clicked the vertical scroll bar thumb, one of the scales would jump. I.e. the scales would no longer match up where they did before. This happened when you just clicked the thumb, before any actual scrolling had taken place. When scrolling, the two plotted series would pan at different rates.
This happened when the scales had min/max auto = true, and the min/max values were being rounded up or down to "nice" values. Only happened when the rounding amount exceeded the calculated scrollgrace value.
SetScrollRangeFromData() was setting the scroll range based on rangeMin/Max + grace, but not handling the fact that the actual min/max of the scale might be outside this range.
I've attached a simple fix for this that resolved the issue for my test case.