diff scripts/plot/axis.m @ 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 b052b844e094
children 73d6b71788c0
line wrap: on
line diff
--- 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)