Mercurial > hg > octave-lyh
changeset 7292:5e90111a28b3
[project @ 2007-12-11 18:13:34 by jwe]
author | jwe |
---|---|
date | Tue, 11 Dec 2007 18:15:06 +0000 |
parents | de593fd63ecf |
children | d45fc511fc5d |
files | scripts/ChangeLog scripts/plot/__go_draw_axes__.m scripts/plot/plot3.m scripts/plot/ribbon.m scripts/plot/slice.m scripts/plot/surface.m |
diffstat | 6 files changed, 20 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -3,6 +3,14 @@ * plot/__plt2vs__.m, plot/__plt2sv__.m: New functions. * plot/__plt2__.m: Handle scalar-vector and vector-scalar cases. +2007-12-11 Kai Habel <kai.habel@gmx.de> + + * plot/slice.m: Remove unused variable, set xgrid, ygrid, and + zgrid to "on" and box to "off" for used axes. + + * plot/__go_draw_axes__.m, plot/plot3.m, plot/ribbon.m, + plot/slice.m: Use size_equal(var1,var2,...) when possible. + 2007-12-11 David Bateman <dbateman@free.fr> * miscelleaneous/fullfile.m: Ignore empty arguments.
--- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -844,7 +844,7 @@ err = true; endif elseif (ismatrix (xdat) && ismatrix (ydat) && ismatrix (zdat)) - if (! (size_equal (xdat, ydat) && size_equal (xdat, zdat))) + if (! size_equal (xdat, ydat, zdat)) err = true; endif else
--- a/scripts/plot/plot3.m +++ b/scripts/plot/plot3.m @@ -167,7 +167,7 @@ endif endif - if (! size_equal (x, y) || ! size_equal (x, z)) + if (! size_equal (x, y, z)) error ("plot3: x, y, and z must have the same shape"); endif @@ -211,7 +211,7 @@ endif endif - if (! size_equal (x, y) || ! size_equal (x, z)) + if (! size_equal (x, y, z)) error ("plot3: x, y, and z must have the same shape"); endif @@ -275,7 +275,7 @@ endif endif - if (! size_equal (x, y) || ! size_equal (x, z)) + if (! size_equal (x, y, z)) error ("plot3: x, y, and z must have the same shape"); endif
--- a/scripts/plot/ribbon.m +++ b/scripts/plot/ribbon.m @@ -55,7 +55,7 @@ [x, y] = meshgrid (x, y); endif else - if (! all (size (x) == size (y))) + if (! size_equal(x, y)) error ("ribbon: in case of matrices, X and Y must have same size") endif endif
--- a/scripts/plot/slice.m +++ b/scripts/plot/slice.m @@ -72,7 +72,6 @@ function h = slice (varargin) method = "linear"; - extrapval = NA; nargs = nargin; if (ischar (varargin{end})) @@ -100,7 +99,7 @@ z = varargin{3}; if (all ([isvector(x), isvector(y), isvector(z)])) [x, y, z] = meshgrid (x, y, z); - elseif (ndims (x) == 3 && size_equal (x, y) && size_equal (x, z)) + elseif (ndims (x) == 3 && size_equal (x, y, z)) ## Do nothing. else error ("slice: X, Y, Z size mismatch") @@ -114,7 +113,7 @@ if (any ([isvector(sx), isvector(sy), isvector(sz)])) have_sval = true; - elseif (ndims(sx) == 2 && size_equal (sx, sy) && size_equal (sx, sz)) + elseif (ndims(sx) == 2 && size_equal (sx, sy, sz)) have_sval = false; else error ("slice: dimensional mismatch for (XI, YI, ZI) or (SX, SY, SZ)"); @@ -160,11 +159,12 @@ endif else vi = interp3 (x, y, z, v, sx, sy, sz); - tmp(sidx++) = surface (sx, sy, sz, vi); + tmp = surface (sx, sy, sz, vi); endif if (! ishold ()) - set (ax, "view", [-37.5, 30.0]); + set (ax, "view", [-37.5, 30.0], "box", "off", "xgrid", "on", + "ygrid", "on", "zgrid", "on"); endif if (nargout > 0)
--- a/scripts/plot/surface.m +++ b/scripts/plot/surface.m @@ -92,7 +92,7 @@ error ("surface: rows (z) must be the same as length (y) and columns (z) must be the same as length (x)"); endif elseif (ismatrix (x) && ismatrix (y) && ismatrix (z)) - if (! (size_equal (x, y) && size_equal (x, z))) + if (! size_equal (x, y, z)) error ("surface: x, y, and z must have same dimensions"); endif else @@ -111,7 +111,7 @@ error ("surface: rows (z) must be the same as length (y) and columns (z) must be the same as length (x)"); endif elseif (ismatrix (x) && ismatrix (y) && ismatrix (z)) - if (! (size_equal (x, y) && size_equal (x, z))) + if (! size_equal (x, y, z)) error ("surface: x, y, and z must have same dimensions"); endif else