Mercurial > hg > octave-nkf
diff scripts/geometry/voronoi.m @ 17125:b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
* scripts/geometry/voronoi.m, scripts/image/imagesc.m,
scripts/plot/__plt_get_axis_arg__.m, scripts/plot/axes.m, scripts/plot/cla.m,
scripts/plot/colorbar.m, scripts/plot/hold.m, scripts/plot/legend.m,
scripts/plot/plotmatrix.m, scripts/plot/plotyy.m,
scripts/plot/private/__errplot__.m, scripts/plot/private/__plt__.m,
scripts/plot/view.m: Use new isaxes function to simplify code.
* scripts/plot/shading.m: Use Octave convention for spacing of parentheses.
* scripts/plot/zlabel.m: Correct %!test incorrectly calling plot3 with figure
handle.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 31 Jul 2013 16:27:49 -0700 |
parents | b99c52303d0b |
children | bc924baa2c4e |
line wrap: on
line diff
--- a/scripts/geometry/voronoi.m +++ b/scripts/geometry/voronoi.m @@ -74,13 +74,13 @@ narg = 1; if (isscalar (varargin{1}) && ishandle (varargin{1})) - handl = varargin{1}; - if (! strcmp (get (handl, "type"), "axes")) - error ("voronoi: expecting first argument to be an axes object"); + hax = varargin{1}; + if (! isaxes (harg)) + error ("imagesc: HAX argument must be an axes object"); endif narg++; elseif (nargout < 2) - handl = gca (); + hax = gca (); endif if (nargin < 1 + narg || nargin > 3 + narg) @@ -154,7 +154,7 @@ Vvy = reshape (p(edges, 2), size (edges)); if (nargout < 2) - h = plot (handl, Vvx, Vvy, linespec{:}, x, y, '+'); + h = plot (hax, Vvx, Vvy, linespec{:}, x, y, '+'); lim = [xmin, xmax, ymin, ymax]; axis (lim + 0.1 * [[-1, 1] * xdelta, [-1, 1] * ydelta]); if (nargout == 1)