# HG changeset patch # User jwe # Date 1176237537 0 # Node ID 747ba2dc157e01779c907cda774bdcbffb28627a # Parent 73ce4e14d35d14e47470cbc68f4f98485d4b161f [project @ 2007-04-10 20:38:57 by jwe] diff -r 73ce4e14d35d -r 747ba2dc157e scripts/ChangeLog --- a/scripts/ChangeLog Tue Apr 10 01:50:48 2007 +0000 +++ b/scripts/ChangeLog Tue Apr 10 20:38:57 2007 +0000 @@ -1,3 +1,8 @@ +2007-04-10 John W. Eaton + + * plot/__go_draw_axes__.m: Try harder to handle min and max vals + that are close but not exactly equal. + 2007-04-09 Daniel J. Sebald * plot/stem.m: Add back the baseline line and let it be not adjustable diff -r 73ce4e14d35d -r 747ba2dc157e scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Tue Apr 10 01:50:48 2007 +0000 +++ b/scripts/plot/__go_draw_axes__.m Tue Apr 10 20:38:57 2007 +0000 @@ -707,9 +707,10 @@ endif warning ("axis: omitting negative data in log plot"); endif - if (min_val == max_val) - min_val = 0.9 * min_val; - max_val = 1.1 * max_val; + ## FIXME -- maybe this test should also be relative? + if (abs (min_val - max_val) < sqrt (eps)) + min_val *= 0.9; + max_val *= 1.1; endif min_val = 10 ^ floor (log10 (min_val)); max_val = 10 ^ ceil (log10 (max_val)); @@ -717,9 +718,10 @@ if (min_val == 0 && max_val == 0) min_val = -1; max_val = 1; - elseif (min_val == max_val) - min_val = 0.9 * min_val; - max_val = 1.1 * max_val; + ## FIXME -- maybe this test should also be relative? + elseif (abs (min_val - max_val) < sqrt (eps)) + min_val -= 0.1 * abs (min_val); + max_val += 0.1 * abs (max_val); endif ## FIXME -- to do a better job, we should consider the tic spacing. scale = 10 ^ floor (log10 (max_val - min_val) - 1);