Mercurial > hg > octave-nkf
diff scripts/plot/__stem__.m @ 8070:3b53b25e2550
Add data sources and line series
author | David Bateman <dbateman@free.fr> |
---|---|
date | Thu, 28 Aug 2008 12:23:54 -0400 |
parents | 9a6f4713f765 |
children | a028a5960e18 |
line wrap: on
line diff
--- a/scripts/plot/__stem__.m +++ b/scripts/plot/__stem__.m @@ -31,7 +31,8 @@ [ax, varargin, nargin] = __plt_get_axis_arg__ (caller, varargin{:}); - [x, y, z, dofill, llc, ls, mmc, ms] = check_stem_arg (have_z, varargin{:}); + [x, y, z, dofill, llc, ls, mmc, ms, varargin] = ... + check_stem_arg (have_z, varargin{:}); oldax = gca (); unwind_protect @@ -58,6 +59,8 @@ hg = hggroup (); h = [h; hg]; + __add_datasource__ (caller, hg, {"x", "y", "z"}, varargin{:}); + if (i == 1) set (ax, "nextplot", "add"); endif @@ -147,7 +150,7 @@ end_unwind_protect endfunction -function [x, y, z, dofill, lc, ls, mc, ms] = check_stem_arg (have_z, varargin) +function [x, y, z, dofill, lc, ls, mc, ms, newargs] = check_stem_arg (have_z, varargin) if (have_z) caller = "stem3"; @@ -155,6 +158,21 @@ caller = "stem"; endif + ## Remove prop/val pairs from data to consider + i = 2; + newargs = {}; + while (i < length (varargin)) + if (ischar (varargin{i}) && !(strcmpi ("fill", varargin{i}) || + strcmpi ("filled", varargin{i}))) + newargs{end + 1} = varargin{i}; + newargs{end + 1} = varargin{i + 1}; + nargin = nargin - 2; + varargin(i:i+1) = []; + else + i++; + endif + endwhile + ## set specifiers to default values [lc, ls, mc, ms] = set_default_values (); dofill = 0;