annotate scripts/plot/draw/errorbar.m @ 18347:238aa26b30e3 stable

doc: Re-write documentation for errorbar family of functions. * errorbar.m: Rewrite docstring. * loglogerr.m, semilogxerr.m, semilogyerr.m: Update list of forms showing how function can be called.
author Rik <rik@octave.org>
date Thu, 23 Jan 2014 12:49:07 -0800
parents d63878346099
children cafffc1b70b1 446c46af4b42
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17572
diff changeset
1 ## Copyright (C) 2000-2013 Teemu Ikonen
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
2 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
4 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## your option) any later version.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
9 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
14 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## <http://www.gnu.org/licenses/>.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
18
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
20 ## @deftypefn {Function File} {} errorbar (@var{y}, @var{ey})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
21 ## @deftypefnx {Function File} {} errorbar (@var{y}, @dots{}, @var{fmt})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
22 ## @deftypefnx {Function File} {} errorbar (@var{x}, @var{y}, @var{ey})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
23 ## @deftypefnx {Function File} {} errorbar (@var{x}, @var{y}, @var{err}, @var{fmt})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
24 ## @deftypefnx {Function File} {} errorbar (@var{x}, @var{y}, @var{lerr}, @var{uerr}, @var{fmt})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
25 ## @deftypefnx {Function File} {} errorbar (@var{x}, @var{y}, @var{ex}, @var{ey}, @var{fmt})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
26 ## @deftypefnx {Function File} {} errorbar (@var{x}, @var{y}, @var{lx}, @var{ux}, @var{ly}, @var{uy}, @var{fmt})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
27 ## @deftypefnx {Function File} {} errorbar (@var{x1}, @var{y1}, @dots{}, @var{fmt}, @var{xn}, @var{yn}, @dots{})
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
28 ## @deftypefnx {Function File} {} errorbar (@var{hax}, @dots{})
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
29 ## @deftypefnx {Function File} {@var{h} =} errorbar (@dots{})
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
30 ## Create a 2-D plot with errorbars.
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
31 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
32 ## Many different combinations of arguments are possible. The simplest form is
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
33 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
34 ## @example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
35 ## errorbar (@var{y}, @var{ey})
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
36 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
37 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
38 ## @noindent
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
39 ## where the first argument is taken as the set of @var{y} coordinates, the
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
40 ## second argument @var{ey} are the errors around the @var{y} values, and the
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
41 ## @var{x} coordinates are taken to be the indices of the elements
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
42 ## (@code{1:numel (@var{y})}).
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
43 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
44 ## The general form of the function is
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
45 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
46 ## @example
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
47 ## errorbar (@var{x}, @var{y}, @var{err1}, @dots{}, @var{fmt}, @dots{})
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
48 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
49 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
50 ## @noindent
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
51 ## After the @var{x} and @var{y} arguments there can be 1, 2, or 4
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
52 ## parameters specifying the error values depending on the nature of the error
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
53 ## values and the plot format @var{fmt}.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
54 ##
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
55 ## @table @asis
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
56 ## @item @var{err} (scalar)
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
57 ## When the error is a scalar all points share the same error value.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
58 ## The errorbars are symmetric and are drawn from @var{data}-@var{err} to
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
59 ## @var{data}+@var{err}.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
60 ## The @var{fmt} argument determines whether @var{err} is in the x-direction,
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
61 ## y-direction (default), or both.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
62 ##
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
63 ## @item @var{err} (vector or matrix)
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
64 ## Each data point has a particular error value.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
65 ## The errorbars are symmetric and are drawn from @var{data}(n)-@var{err}(n) to
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
66 ## @var{data}(n)+@var{err}(n).
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
67 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
68 ## @item @var{lerr}, @var{uerr} (scalar)
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
69 ## The errors have a single low-side value and a single upper-side value.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
70 ## The errorbars are not symmetric and are drawn from @var{data}-@var{lerr} to
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
71 ## @var{data}+@var{uerr}.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
72 ##
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
73 ## @item @var{lerr}, @var{uerr} (vector or matrix)
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
74 ## Each data point has a low-side error and an upper-side error.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
75 ## The errorbars are not symmetric and are drawn from
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
76 ## @var{data}(n)-@var{lerr}(n) to @var{data}(n)+@var{uerr}(n).
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
77 ## @end table
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
78 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
79 ## Any number of data sets (@var{x1},@var{y1}, @var{x2},@var{y2}, @dots{}) may
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
80 ## appear as long as they are separated by a format string @var{fmt}.
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
81 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
82 ## If @var{y} is a matrix, @var{x} and the error parameters must also be
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
83 ## matrices having the same dimensions. The columns of @var{y} are plotted
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
84 ## versus the corresponding columns of @var{x} and errorbars are taken from
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
85 ## the corresponding columns of the error parameters.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
86 ##
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
87 ## If @var{fmt} is missing, the yerrorbars ("~") plot style is assumed.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
88 ##
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
89 ## If the @var{fmt} argument is supplied then it is interpreted, as in normal
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
90 ## plots, to specify the line style, marker, and color. In addition,
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
91 ## @var{fmt} may include an errorbar style which @strong{must precede} the
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
92 ## ordinary format codes. The following errorbar styles are supported:
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
93 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
94 ## @table @samp
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
95 ## @item ~
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
96 ## Set yerrorbars plot style (default).
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
97 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
98 ## @item >
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
99 ## Set xerrorbars plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
100 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
101 ## @item ~>
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
102 ## Set xyerrorbars plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
103 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
104 ## @item #~
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
105 ## Set yboxes plot style.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
106 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
107 ## @item #
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
108 ## Set xboxes plot style.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
109 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
110 ## @item #~>
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
111 ## Set xyboxes plot style.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
112 ## @end table
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
113 ##
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
114 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
115 ## rather than the current axes returned by @code{gca}.
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
116 ##
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
117 ## The optional return value @var{h} is a handle to the hggroup object
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
118 ## representing the data plot and errorbars.
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
119 ##
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
120 ## Note: For compatibility with @sc{matlab} a line is drawn through all data
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
121 ## points. However, most scientific errorbar plots are a scatter plot of
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
122 ## points with errorbars. To accomplish this, add a marker style to the
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
123 ## @var{fmt} argument such as @qcode{"."}. Alternatively, remove the line
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
124 ## by modifying the returned graphic handle with
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
125 ## @code{set (h, "linestyle", "none")}.
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
126 ##
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
127 ## Examples:
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
128 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
129 ## @example
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
130 ## errorbar (@var{x}, @var{y}, @var{ex}, ">.r")
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
131 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
132 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10591
diff changeset
133 ## @noindent
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
134 ## produces an xerrorbar plot of @var{y} versus @var{x} with @var{x}
18347
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
135 ## errorbars drawn from @var{x}-@var{ex} to @var{x}+@var{ex}. The marker
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
136 ## @qcode{"."} is used so no connecting line is drawn and the errorbars
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
137 ## appear in red.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
138 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
139 ## @example
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
140 ## @group
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
141 ## errorbar (@var{x}, @var{y1}, @var{ey}, "~",
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
142 ## @var{x}, @var{y2}, @var{ly}, @var{uy})
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
143 ## @end group
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
144 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
145 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10591
diff changeset
146 ## @noindent
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
147 ## produces yerrorbar plots with @var{y1} and @var{y2} versus @var{x}.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
148 ## Errorbars for @var{y1} are drawn from @var{y1}-@var{ey} to
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
149 ## @var{y1}+@var{ey}, errorbars for @var{y2} from @var{y2}-@var{ly} to
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
150 ## @var{y2}+@var{uy}.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
151 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
152 ## @example
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
153 ## @group
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
154 ## errorbar (@var{x}, @var{y}, @var{lx}, @var{ux},
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
155 ## @var{ly}, @var{uy}, "~>")
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
156 ## @end group
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
157 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
158 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10591
diff changeset
159 ## @noindent
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
160 ## produces an xyerrorbar plot of @var{y} versus @var{x} in which
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
161 ## @var{x} errorbars are drawn from @var{x}-@var{lx} to @var{x}+@var{ux}
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6701
diff changeset
162 ## and @var{y} errorbars from @var{y}-@var{ly} to @var{y}+@var{uy}.
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17059
diff changeset
163 ## @seealso{semilogxerr, semilogyerr, loglogerr, plot}
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
164 ## @end deftypefn
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
165
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
166 ## Created: 18.7.2000
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
167 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
168 ## Keywords: errorbar, plotting
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
169
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
170 function h = errorbar (varargin)
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
171
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
172 [hax, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
7216
5389a52df87b [project @ 2007-11-29 19:07:29 by jwe]
jwe
parents: 7207
diff changeset
173
17211
87ba70043bfc Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents: 17190
diff changeset
174 oldfig = [];
17301
68bcac3c043a Correct inversion accidentally introduced in cset 87ba70043bfc.
Rik <rik@octave.org>
parents: 17211
diff changeset
175 if (! isempty (hax))
17211
87ba70043bfc Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents: 17190
diff changeset
176 oldfig = get (0, "currentfigure");
87ba70043bfc Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents: 17190
diff changeset
177 endif
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
178 unwind_protect
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
179 hax = newplot (hax);
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
180
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
181 htmp = __errcomm__ ("errorbar", hax, varargin{:});
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
182 unwind_protect_cleanup
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
183 if (! isempty (oldfig))
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
184 set (0, "currentfigure", oldfig);
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
185 endif
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
186 end_unwind_protect
7510
f3e6ada67d9e improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents: 7216
diff changeset
187
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
188 if (nargout > 0)
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
189 h = htmp;
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
190 endif
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
191
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
192 endfunction
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7510
diff changeset
193
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7510
diff changeset
194
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7510
diff changeset
195 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
196 %! clf;
11363
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
197 %! rand_1x11_data1 = [0.82712, 0.50325, 0.35613, 0.77089, 0.20474, 0.69160, 0.30858, 0.88225, 0.35187, 0.14168, 0.54270];
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
198 %! rand_1x11_data2 = [0.506375, 0.330106, 0.017982, 0.859270, 0.140641, 0.327839, 0.275886, 0.162453, 0.807592, 0.318509, 0.921112];
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
199 %! errorbar (0:10, rand_1x11_data1, 0.25*rand_1x11_data2);
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
200 %! title ('errorbar() with Y errorbars');
11363
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
201
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
202 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
203 %! clf;
11363
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
204 %! rand_1x11_data3 = [0.423650, 0.142331, 0.213195, 0.129301, 0.975891, 0.012872, 0.635327, 0.338829, 0.764997, 0.401798, 0.551850];
a0dfd7e8e3e2 Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents: 11099
diff changeset
205 %! rand_1x11_data4 = [0.682566, 0.456342, 0.132390, 0.341292, 0.108633, 0.601553, 0.040455, 0.146665, 0.309187, 0.586291, 0.540149];
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
206 %! errorbar (0:10, rand_1x11_data3, rand_1x11_data4, '>');
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
207 %! title ('errorbar() with X errorbars');
10589
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
208
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
209 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
210 %! clf;
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
211 %! x = 0:0.5:2*pi;
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
212 %! err = x/30;
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
213 %! y1 = sin (x);
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
214 %! y2 = cos (x);
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
215 %! errorbar (x, y1, err, '~', x, y2, err, '>');
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
216 %! legend ("Y errbar", "X errbar");
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
217 %! title ('errorbar() with 2 datasets');
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
218
10589
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
219
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
220 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
221 %! clf;
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
222 %! x = 0:0.5:2*pi;
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
223 %! err = x/30;
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
224 %! y1 = sin (x);
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
225 %! y2 = cos (x);
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
226 %! errorbar (x, y1, err, err, '#r', x, y2, err, err, '#~');
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
227 %! legend ("X errbox", "Y errbox");
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
228 %! title ('errorbar() with error boxes');
10589
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
229
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
230 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
231 %! clf;
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
232 %! x = 0:0.5:2*pi;
17059
c935a0db31c6 errorbar.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
233 %! err = x/30;
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
234 %! y1 = sin (x);
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
235 %! y2 = cos (x);
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
236 %! errorbar (x, y1, err, err, err, err, '~>', ...
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
237 %! x, y2, err, err, err, err, '#~>-*');
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
238 %! legend ("X-Y errbars", "X-Y errboxes");
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17126
diff changeset
239 %! title ('errorbar() with X-Y errorbars and error boxes');
10589
b6364a88de06 errorbar.m: Add demoss.
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
240
17435
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
241 ## Invisible figure used for tests
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
242 %!shared hf, hax
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
243 %! hf = figure ("visible", "off");
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
244 %! hax = axes;
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
245
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
246 %!error errorbar ()
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
247 %!error errorbar (1)
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
248 %!error <data argument 1 must be numeric> errorbar (hax, {1}, 2)
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
249 %!error <data argument 2 must be numeric> errorbar (hax, 1, {2})
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
250 %!error <size of argument 2 does not match others> errorbar (hax, 1, 1:2)
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
251 %!error <size of argument 3 does not match others> errorbar (hax, 1, 2, 3:4)
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
252 %!error <too many arguments to plot> errorbar (1,2,3,4,5,6,7)
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
253
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
254 %!error <2 column errorplot is only valid for xerr> errorbar (1,2, "~>")
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
255 %!error <6 columns only valid for xyerr and boxxy> errorbar (1,2,3,4,5,6, "~")
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
256 %!error <error plot requires 2, 3, 4, or 6 arguments> errorbar (1,2,3,4,5)
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
257
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
258 ## Close figure used for testing
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
259 %!test
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
260 %! close (hf);
4a6a4657fdf2 Overhaul errorbar family of functions.
Rik <rik@octave.org>
parents: 17301
diff changeset
261