|
From: Daniel J S. <dan...@ie...> - 2006-06-28 17:03:30
|
Ethan Merritt wrote:
> On Wednesday 28 June 2006 08:07 am, Petr Mikulik wrote:
>
>>>I've placed a patch under bug report [ 1004754 ] on SourceForge
>>>that is a cleanup of the tic generation. I think it would be worth
>>>considering for 4.2, because it does fix the bug and it is much
>>>friendlier computer math
>>
>>I propose to commit it.
>>
>>Notes: "logorithm" => "logarithm"
>
>
> I have not analyzed the code itself, and don't have time to
> do so right now. But the cover explanation contains an
> off-by-one error in the algorithm, so I worry that it is not
> correct.
That is fine in this new layout. It's explained in the note. (But if you are uncomfortable with it, leave it out for now.)
I will use [ ] to signify range (i.e., lmin and lmax), and I will use T to be major tic and t to be minor tic.
[ ]
t T t t t t T t
^ ^
start outside
i_tic= 0 0 0 0 0 1 1 ...
The scheme is to first "integerize" the major tics where "start" will be the case of i_tic = 0. (I should say, that we don't round the upper limit upward anymore, but downward because if it is outside of the range, it isn't printed.) In this case N_start and N_end are the same. We only need one interval and minor tics.
Imagine the case of moving that upper range "]" so that it equals a major tic. Well in that case, with the rounding downward (floor) it will be that N_end = N_start + 1, and we'll get two intervals of major tic and minor tics. (The minor tics will be outside the range and not printed, but that is the idea.)
Dan
|