So nothing to do with setting via ui_control. I assume it is the way the algorithm works. It seems to put the grid lines at appropriate intervals for the range, so in this case 40 spacing and then adds the top and bottom values. If you can think of a better algorithm you could propose it. A question, what would you want to see if the range were 12345 to 13456?