changeset 17449:aa380b380315

axis.m: Fix bug when data sets differ in size and dimension (bug #40036). * scripts/plot/axis.m: Consolidate all data sets into a single column vector before finding min/max for tight limits.
author Rik <rik@octave.org>
date Mon, 16 Sep 2013 09:15:24 -0700
parents cc7815488981
children 15d592c82abc
files scripts/plot/axis.m
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/axis.m
+++ b/scripts/plot/axis.m
@@ -333,15 +333,15 @@
     if (strcmp (scale, "log"))
       tmp = data;
       data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false);
-      n = cellfun (@isempty, data);
+      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));
     if (! isempty (data))
-      lims_min = min ([data{:}](:));
-      lims_max = max ([data{:}](:));
-      lims = [lims_min, lims_max];
+      ## Change data from cell array of various sizes to a single column vector
+      data = cat (1, cellindexmat (data, ":"){:});
+      lims = [min(data), max(data)];
     else
       lims = [0, 1];
     endif