Ticking function grapher
Using deltaX
if deltax between 2 and 10 half increment
if deltax between 10 and 20 unit increment
if smaller than 2 we multiply by 10 and test again
if larger than 20 we divide 
Then we get the position of the first unit or half increment on the width using xmin.
I still need to test this solution.
I am trying to figure out the following problem.
I am building Yet another math function grapher, The function is drawn on its predefined x,y range, that's all good.
Now I am working on the background and the ticking of X, Y axes (if any axes are shown).
I worked out the following.
I have a fixed width  of 250 p
The tick gap should be between 12.5 and 50p.
The ticks should indicate either unit or half unit range, by that i mean the following.
x range (-5, 5): one tick = 1
x range (-1, 1): one tick = 0.5 or 0.1 depending on the gap that each of this option would generate. 
x range (0.1, 0.3): 0.05 
Given a Xrange
How would you get the number of ticks between either full or half unit range ?
Or maybe there are other way to approach this type of problems.