# HG changeset patch # User Ben Abbott # Date 1245301757 -7200 # Node ID abe4d6657872c027e5baebb8a4948bddae4f36b3 # Parent 5530fe42c83bb5fcaf5c108b7ba22d2657f8ff42 axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo. diff -r 5530fe42c83b -r abe4d6657872 scripts/ChangeLog --- a/scripts/ChangeLog Thu Jun 18 07:09:17 2009 +0200 +++ b/scripts/ChangeLog Thu Jun 18 07:09:17 2009 +0200 @@ -1,3 +1,8 @@ +2009-06-17 Bertrand Roessli + + * plot/axis.m: Fix bug for 'axis tight' with multiple surface plots, + add demo. + 2009-06-14 Ben Abbott * plot/quiver.m: Add 'clf' to demos. diff -r 5530fe42c83b -r abe4d6657872 scripts/plot/axis.m --- a/scripts/plot/axis.m Thu Jun 18 07:09:17 2009 +0200 +++ b/scripts/plot/axis.m Thu Jun 18 07:09:17 2009 +0200 @@ -300,8 +300,9 @@ if (iscell (data)) data = data (find (! cellfun (@isempty, data))); if (! isempty (data)) - lims(1) = min (cellfun (@min, data)(:)); - lims(2) = max (cellfun (@max, data)(:)); + lims_min = min (cellfun (@min, cellfun (@min, data, 'UniformOutput', false)(:))); + lims_max = max (cellfun (@max, cellfun (@max, data, 'UniformOutput', false)(:))); + lims = [lims_min, lims_max]; else lims = [0, 1]; endif @@ -309,6 +310,8 @@ lims = [min(data(:)), max(data(:))]; endif endif + + endfunction function __do_tight_option__ (ca) @@ -445,4 +448,14 @@ %! axis image %! title("image") +%!demo +%! clf +%! [x,y,z] = peaks(50); +%! x1 = max(x(:)); +%! pcolor(x-x1,y-x1/2,z) +%! hold on +%! [x,y,z] = sombrero; +%! s = x1/max(x(:)); +%! pcolor(s*x+x1,s*y+x1/2,5*z) +%! axis tight