Mercurial > hg > octave-lyh
annotate scripts/plot/errorbar.m @ 9209:923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
spellchecked all .txi and .texi files.
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Sun, 17 May 2009 12:18:06 -0700 |
parents | 1bf0ce0930be |
children | 16f53d29049f |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Teemu Ikonen |
3718 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
3718 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
3718 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} errorbar (@var{args}) | |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
21 ## This function produces two-dimensional plots with errorbars. Many |
3718 | 22 ## different combinations of arguments are possible. The simplest form is |
23 ## | |
24 ## @example | |
25 ## errorbar (@var{y}, @var{ey}) | |
26 ## @end example | |
27 ## | |
28 ## @noindent | |
29 ## where the first argument is taken as the set of @var{y} coordinates | |
30 ## and the second argument @var{ey} is taken as the errors of the | |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
31 ## @var{y} values. @var{x} coordinates are taken to be the indices |
3718 | 32 ## of the elements, starting with 1. |
33 ## | |
34 ## If more than two arguments are given, they are interpreted as | |
35 ## | |
36 ## @example | |
6701 | 37 ## errorbar (@var{x}, @var{y}, @dots{}, @var{fmt}, @dots{}) |
3718 | 38 ## @end example |
39 ## | |
40 ## @noindent | |
41 ## where after @var{x} and @var{y} there can be up to four error | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
42 ## parameters such as @var{ey}, @var{ex}, @var{ly}, @var{uy}, etc., |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
43 ## depending on the plot type. Any number of argument sets may appear, |
3718 | 44 ## as long as they are separated with a format string @var{fmt}. |
45 ## | |
46 ## If @var{y} is a matrix, @var{x} and error parameters must also be matrices | |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
47 ## having same dimensions. The columns of @var{y} are plotted versus the |
3718 | 48 ## corresponding columns of @var{x} and errorbars are drawn from |
49 ## the corresponding columns of error parameters. | |
50 ## | |
6895 | 51 ## If @var{fmt} is missing, yerrorbars ("~") plot style is assumed. |
52 ## | |
3718 | 53 ## If the @var{fmt} argument is supplied, it is interpreted as in |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
54 ## normal plots. In addition the following plot styles are supported by |
6895 | 55 ## errorbar: |
3718 | 56 ## |
57 ## @table @samp | |
58 ## @item ~ | |
59 ## Set yerrorbars plot style (default). | |
60 ## | |
61 ## @item > | |
62 ## Set xerrorbars plot style. | |
63 ## | |
64 ## @item ~> | |
65 ## Set xyerrorbars plot style. | |
66 ## | |
67 ## @item # | |
68 ## Set boxes plot style. | |
69 ## | |
70 ## @item #~ | |
71 ## Set boxerrorbars plot style. | |
72 ## | |
73 ## @item #~> | |
74 ## Set boxxyerrorbars plot style. | |
75 ## @end table | |
76 ## | |
77 ## Examples: | |
78 ## | |
79 ## @example | |
6895 | 80 ## errorbar (@var{x}, @var{y}, @var{ex}, ">") |
3718 | 81 ## @end example |
82 ## | |
6895 | 83 ## produces an xerrorbar plot of @var{y} versus @var{x} with @var{x} |
84 ## errorbars drawn from @var{x}-@var{ex} to @var{x}+@var{ex}. | |
3718 | 85 ## |
86 ## @example | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
9040
diff
changeset
|
87 ## @group |
6895 | 88 ## errorbar (@var{x}, @var{y1}, @var{ey}, "~", |
89 ## @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
|
90 ## @end group |
3718 | 91 ## @end example |
92 ## | |
6895 | 93 ## produces yerrorbar plots with @var{y1} and @var{y2} versus @var{x}. |
3718 | 94 ## Errorbars for @var{y1} are drawn from @var{y1}-@var{ey} to |
95 ## @var{y1}+@var{ey}, errorbars for @var{y2} from @var{y2}-@var{ly} to | |
96 ## @var{y2}+@var{uy}. | |
97 ## | |
98 ## @example | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
9040
diff
changeset
|
99 ## @group |
6895 | 100 ## errorbar (@var{x}, @var{y}, @var{lx}, @var{ux}, |
101 ## @var{ly}, @var{uy}, "~>") | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
9040
diff
changeset
|
102 ## @end group |
3718 | 103 ## @end example |
104 ## | |
6895 | 105 ## produces an xyerrorbar plot of @var{y} versus @var{x} in which |
106 ## @var{x} errorbars are drawn from @var{x}-@var{lx} to @var{x}+@var{ux} | |
107 ## and @var{y} errorbars from @var{y}-@var{ly} to @var{y}+@var{uy}. | |
108 ## @seealso{semilogxerr, semilogyerr, loglogerr} | |
3718 | 109 ## @end deftypefn |
110 | |
111 ## Created: 18.7.2000 | |
112 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> | |
113 ## Keywords: errorbar, plotting | |
114 | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
115 function retval = errorbar (varargin) |
3718 | 116 |
7207 | 117 [h, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:}); |
7216 | 118 |
7207 | 119 oldh = gca (); |
120 unwind_protect | |
121 axes (h); | |
122 newplot (); | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
123 |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
124 tmp = __errcomm__ ("errorbar", h, varargin{:}); |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
125 |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
126 if (nargout > 0) |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
127 retval = tmp; |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
128 endif |
7207 | 129 unwind_protect_cleanup |
130 axes (oldh); | |
131 end_unwind_protect | |
3718 | 132 |
133 endfunction | |
8258 | 134 |
135 %!demo | |
136 %! errorbar(0:10,rand(1,11),0.25*rand(1,11)) | |
137 | |
138 %!demo | |
139 %! errorbar(0:10,rand(1,11),rand(1,11), ">") |