Mercurial > hg > octave-nkf
diff scripts/plot/axis.m @ 14063:6875d23ce051 stable
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
* axis.m: Fix regression of tight axis limits introduced by
changeset ec79cd8359c5. Add test.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 16 Dec 2011 07:59:58 -0500 |
parents | ec79cd8359c5 |
children | 22c50cbad2ce |
line wrap: on
line diff
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -323,7 +323,10 @@ data = {data}; end if (strcmp (scale, "log")) - data = cellfun (@(x) x(x>0), data, "uniformoutput", false); + tmp = data; + data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false); + n = cellfun (@isempty, data); + data(n) = cellfun (@(x) x(x<0), tmp(n), "uniformoutput", false); endif data = cellfun (@(x) x(isfinite(x)), data, "uniformoutput", false); data = data(! cellfun ("isempty", data)); @@ -554,8 +557,19 @@ %! hold all; %! plot (11:20, 25.5 + rand (10)); %! axis tight; -%! assert (axis, [11 20 21 30]); +%! assert (axis (), [11 20 21 30]); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! a = logspace (-5, 1, 10); +%! loglog (a, -a) +%! axis tight; +%! assert (axis (), [1e-5, 10, -10, -1e-5]) +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect +