scripts/plot/axis.m
changeset 9319 d6052da689e2
parent 9277 be84e9654feb
child 9341 f58cf8c3c63c
     1.1 --- a/scripts/plot/axis.m	Wed May 27 13:06:38 2009 -0700
     1.2 +++ b/scripts/plot/axis.m	Tue Jun 09 06:33:10 2009 +0200
     1.3 @@ -298,14 +298,17 @@
     1.4    else
     1.5      data = get (kids, strcat (ax, "data"));
     1.6      if (iscell (data))
     1.7 -      lims(1) = min (cellfun (@min, data)(:));
     1.8 -      lims(2) = min (cellfun (@max, data)(:));
     1.9 +      data = data (find (! cellfun (@isempty, data)));
    1.10 +      if (! isempty (data))
    1.11 +        lims(1) = min (cellfun (@min, data)(:));
    1.12 +        lims(2) = max (cellfun (@max, data)(:));
    1.13 +      else
    1.14 +        lims = [0, 1];
    1.15 +      endif
    1.16      else
    1.17        lims = [min(data(:)), max(data(:))];
    1.18      endif
    1.19    endif
    1.20 -
    1.21 -
    1.22  endfunction
    1.23  
    1.24  function __do_tight_option__ (ca)
    1.25 @@ -430,7 +433,7 @@
    1.26  %! title("axes at [3 6 0 1], then autoy");
    1.27  %!
    1.28  %! subplot(326);
    1.29 -%! plot(t, x);
    1.30 +%! plot(t, sin(t), t, -2*sin(t/2))
    1.31  %! axis("tight");
    1.32  %! title("tight");
    1.33