From: Daniel J S. <dan...@ie...> - 2004-08-05 19:50:43
|
I looked into this issue of the grid line and tics to the right of the right border. There is a lot of code for the tics, and I notice a comment in the code: /* FIXME HBB 20010121: keeping adding 'step' to 'tic' is * begging for rounding errors to strike us. */ /* HBB 20010410: ... and strike they did :-( */ So there is probably an issue having to do with that. Of course, one thing that could be done is a sanity check to make sure no tics are drawn if outside xleft, xright, xbot, xtop. But those variables are not in the same C file.... Also, there should be a bit of code that would round the border up to 2.0 if [0:1.99805]. What I mean, is that the range should probably be rounded to the nearest, oh, 1/2% of the length. That is, when it comes to the final computation of the range, treat 1.99805 as follows xmax - xmin = 1.99805 (xmax - xmin)*0.005 = 0.0099903 which means we should round to the nearest 0.01, i.e. 1.99805 rounds to 2.0. It is a little bit difficult to imagine an elegant algorithm to do this, but it may involve working with the exponents of floats in exponential notation. (Can't think of any C constructs to do that.) Or perhaps working with logarithms. Not proposing this be done, but I hope you catch my drift. Dan |