Mercurial > hg > octave-nkf
diff scripts/plot/axis.m @ 9357:95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 17 Jun 2009 18:49:46 -0400 |
parents | 96abf8f7e5b6 |
children | 7b74a7fd4761 |
line wrap: on
line diff
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -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