# HG changeset patch # User John W. Eaton # Date 1217360053 14400 # Node ID 8ccd9b0bf6bcc747aa43ade83e2a863f562bef2c # Parent 80a715c4824d6ee1f76691e61c418a1e290b81f4 plot/axis.m (__get_tight_lims__): don't fail if data is not a vector diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2008-07-29 John W. Eaton + + * plot/axis.m (__get_tight_lims__): Use strcat instead of []. + Don't fail if data is not a vector. + 2008-07-29 David Bateman * general/cellidx.m: reinclude from control toolbox, as used by diff --git a/scripts/plot/axis.m b/scripts/plot/axis.m --- 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)