Mercurial > hg > octave-terminal
changeset 9317:96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 08 Jun 2009 12:35:07 -0400 |
parents | c539ec5726e7 |
children | 1a1c839625b3 |
files | scripts/ChangeLog scripts/plot/axis.m |
diffstat | 2 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-06-08 Ben Abbott <bpabbott@mac.com> + + * plot/axis.m: Fix bug for 'axis tight' with multiple lines, modify + demo. + 2009-06-07 Thorsten Meyer <thorsten.meyier@gmx.de> * testfun/assert.m: Fix texinfo bug.
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -298,14 +298,17 @@ else data = get (kids, strcat (ax, "data")); if (iscell (data)) - lims(1) = min (cellfun (@min, data)(:)); - lims(2) = min (cellfun (@max, data)(:)); + data = data (find (! cellfun (@isempty, data))); + if (! isempty (data)) + lims(1) = min (cellfun (@min, data)(:)); + lims(2) = max (cellfun (@max, data)(:)); + else + lims = [0, 1]; + endif else lims = [min(data(:)), max(data(:))]; endif endif - - endfunction function __do_tight_option__ (ca) @@ -430,7 +433,7 @@ %! title("axes at [3 6 0 1], then autoy"); %! %! subplot(326); -%! plot(t, x); +%! plot(t, sin(t), t, -2*sin(t/2)) %! axis("tight"); %! title("tight");