# HG changeset patch # User Rik # Date 1379348124 25200 # Node ID aa380b3803152e6070f486994615852ab5dfdd5a # Parent cc7815488981bea38d0170fb4d21c39691de9260 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. diff -r cc7815488981 -r aa380b380315 scripts/plot/axis.m --- a/scripts/plot/axis.m Mon Sep 16 08:20:16 2013 -0700 +++ b/scripts/plot/axis.m Mon Sep 16 09:15:24 2013 -0700 @@ -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