Mercurial > hg > octave-lyh
changeset 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 | b2133f97079d |
children | d4b1314a7c31 |
files | scripts/ChangeLog scripts/plot/axis.m |
diffstat | 2 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-06-17 Bertrand Roessli <bertrand.roessli@psi.ch> + + * plot/axis.m: Fix bug for 'axis tight' with multiple surface plots, + add demo. + 2009-06-15 Ben Abbott <bpabbott@mac.com> * plot/quiver.m: Add 'clf' to demos.
--- 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