Mercurial > hg > octave-lojdl
changeset 12099:b8fa8cba212f release-3-2-x
stairs.m (__stairs__): correct nargin check; new demos
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 20 Nov 2009 10:49:17 +0100 |
parents | 51b151af0ddc |
children | 38f3c198ba63 |
files | scripts/ChangeLog scripts/plot/stairs.m |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-11-11 John W. Eaton <jwe@octave.org> + + * plot/stairs.m (__stairs__): Correct nargin check. New demos. + From Jakub Kasse <jakub.kasse@tul.cz>. + 2009-09-01 Christophe Tournery <christophe.tournery@illusonic.com> * audio/wavread.m: Rename data_size from obsolete ck_size.
--- a/scripts/plot/stairs.m +++ b/scripts/plot/stairs.m @@ -80,7 +80,7 @@ function [h, xs, ys] = __stairs__ (doplot, varargin) - if (nargin == 1 || ischar (varargin{2})) + if (nargin == 2 || ischar (varargin{2})) y = varargin {1}; varargin(1) = []; if (ismatrix (y)) @@ -217,6 +217,13 @@ %! [xs, ys] = stairs (x, y); %! plot (xs, ys); +%!demo +%! stairs (1:9); + +%!demo +%! [xs, ys] = stairs (9:-1:1); +%! plot (xs, ys); + function update_props (h, d) set (get (h, "children"), "color", get (h, "color"), "linewidth", get (h, "linewidth"),