# HG changeset patch # User John W. Eaton # Date 1257979934 18000 # Node ID 965487e0028249b947e7a76feac65141ec829a89 # Parent 873ec09e387a380b450bfdd3f5c1e14c9eeb7dfe stairs.m (__stairs__): correct nargin check; new demos diff -r 873ec09e387a -r 965487e00282 scripts/ChangeLog --- a/scripts/ChangeLog Wed Nov 11 15:22:27 2009 -0500 +++ b/scripts/ChangeLog Wed Nov 11 17:52:14 2009 -0500 @@ -1,3 +1,8 @@ +2009-11-11 John W. Eaton + + * plot/stairs.m (__stairs__): Correct nargin check. New demos. + From Jakub Kasse . + 2009-11-11 John W. Eaton * help/help.m (help): Return immediately after calling do_contents. diff -r 873ec09e387a -r 965487e00282 scripts/plot/stairs.m --- a/scripts/plot/stairs.m Wed Nov 11 15:22:27 2009 -0500 +++ b/scripts/plot/stairs.m Wed Nov 11 17:52:14 2009 -0500 @@ -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"),