Mercurial > hg > octave-lojdl
changeset 7994:8ccd9b0bf6bc
plot/axis.m (__get_tight_lims__): don't fail if data is not a vector
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 29 Jul 2008 15:34:13 -0400 |
parents | 80a715c4824d |
children | 89dd4531b26a |
files | scripts/ChangeLog scripts/plot/axis.m |
diffstat | 2 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2008-07-29 John W. Eaton <jwe@octave.org> + + * plot/axis.m (__get_tight_lims__): Use strcat instead of []. + Don't fail if data is not a vector. + 2008-07-29 David Bateman <dbateman@free.fr> * general/cellidx.m: reinclude from control toolbox, as used by
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -279,20 +279,21 @@ ## Get the limits for axis ("tight"). ## AX should be one of "x", "y", or "z". - kids = findobj (ca, "-property", [ax, "data"]); + kids = findobj (ca, "-property", strcat (ax, "data")); if (isempty (kids)) ## Return the current limits. - lims = get (ca, [ax, "lim"]); + lims = get (ca, strcat (ax, "lim")); else - data = get (kids, [ax, "data"]); + data = get (kids, strcat (ax, "data")); if (iscell (data)) - lims(1) = min (cellfun (@min, data)); - lims(2) = min (cellfun (@max, data)); + lims(1) = min (cellfun (@min, data)(:)); + lims(2) = min (cellfun (@max, data)(:)); else - lims = [min(data), max(data)]; + lims = [min(data(:)), max(data(:))]; end end + endfunction function __do_tight_option__ (ca)