comparison scripts/plot/stem3.m @ 17432:77bec442a35a

Overhaul stem family of plot functions. * scripts/plot/private/__stem__.m: Use low-level plotting fcn __line__ for performance. Add property/listener on 'basevalue' for baseline object. Simplify and correct input option processing so that it actually does the right thing. * scripts/plot/stem.m: Add list of "stem series" properties to docstring. Add titles to %!demos. Add %!error tests for input validation. * scripts/plot/stem3.m: Cross-reference "stem series" to stem documentation. Accept property/value pair inputs. Add %!error tests for input validation.
author Rik <rik@octave.org>
date Wed, 18 Sep 2013 10:32:27 -0700
parents bc924baa2c4e
children fedcd3717ebc
comparison
equal deleted inserted replaced
17431:1dfc3abb0f0d 17432:77bec442a35a
37 ## of the plot. 37 ## of the plot.
38 ## 38 ##
39 ## If the first argument @var{hax} is an axes handle, then plot into this axis, 39 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
40 ## rather than the current axes returned by @code{gca}. 40 ## rather than the current axes returned by @code{gca}.
41 ## 41 ##
42 ## The optional return value @var{h} is a vector with the handles of the line 42 ## The optional return value @var{h} is a handle to the "stem series" hggroup
43 ## and marker objects used to draw the stems as a "stem series" object. 43 ## containing the line and marker objects used for the plot.
44 ## @xref{XREFstem,,stem}, for a description of the "stem series" object.
44 ## 45 ##
45 ## Example: 46 ## Example:
46 ## 47 ##
47 ## @example 48 ## @example
48 ## @group 49 ## @group
58 ## @seealso{stem, bar, hist, plot} 59 ## @seealso{stem, bar, hist, plot}
59 ## @end deftypefn 60 ## @end deftypefn
60 61
61 function h = stem3 (varargin) 62 function h = stem3 (varargin)
62 63
63 if (nargin < 1 || nargin > 4) 64 if (nargin < 1)
64 print_usage (); 65 print_usage ();
65 endif 66 endif
66 67
67 htmp = __stem__ (true, varargin{:}); 68 htmp = __stem__ (true, varargin{:});
68 69
77 %! clf; 78 %! clf;
78 %! theta = 0:0.2:6; 79 %! theta = 0:0.2:6;
79 %! stem3 (cos (theta), sin (theta), theta); 80 %! stem3 (cos (theta), sin (theta), theta);
80 %! title ('stem3() plot'); 81 %! title ('stem3() plot');
81 82
83 %!error stem3 ()
84 %!error <must define X, Y, and Z> stem3 (1,2)
85 %!error <X, Y, and Z must be numeric> stem3 ({1}, 1, 1)
86 %!error <X, Y, and Z must be numeric> stem3 (1, {1}, 1)
87 %!error <X, Y, and Z must be numeric> stem3 (1, 1, {1})
88 %!error <inconsistent sizes for X, Y, and Z> stem3 (ones (2,2), 1, 1);
89 %!error <inconsistent sizes for X, Y, and Z> stem3 (1, ones (2,2), 1);
90 %!error <inconsistent sizes for X, Y, and Z> stem3 (1, 1, ones (2,2));
91 %!error <No value specified for property "FOO"> stem3 (1, "FOO")