annotate scripts/plot/errorbar.m @ 6448:2110cc251779

[project @ 2007-03-24 02:47:36 by jwe]
author jwe
date Sat, 24 Mar 2007 02:47:36 +0000
parents 44c91c5dfe1d
children 4fb053f24fd6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4007
31448e09d38e [project @ 2002-07-26 01:47:32 by jwe]
jwe
parents: 4006
diff changeset
1 ## Copyright (C) 2000, 2001, 2002 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
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 2, or (at your option)
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
8 ## any later version.
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
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
5307
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5252
diff changeset
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5252
diff changeset
18 ## 02110-1301, USA.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
19
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
20 ## -*- texinfo -*-
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
21 ## @deftypefn {Function File} {} errorbar (@var{args})
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
22 ## This function produces two-dimensional plots with errorbars. Many
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
23 ## different combinations of arguments are possible. The simplest form is
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
24 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
25 ## @example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
26 ## errorbar (@var{y}, @var{ey})
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
27 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
28 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
29 ## @noindent
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
30 ## where the first argument is taken as the set of @var{y} coordinates
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
31 ## and the second argument @var{ey} is taken as the errors of the
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
32 ## @var{y} values. @var{x} coordinates are taken to be the indices
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
33 ## of the elements, starting with 1.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
34 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
35 ## If more than two arguments are given, they are interpreted as
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
36 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
37 ## @example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
38 ## errorbar (@var{x}, @var{y}, ..., @var{fmt} ...)
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
39 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
40 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
41 ## @noindent
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
42 ## where after @var{x} and @var{y} there can be up to four error
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
43 ## parameters such as @var{ey}, @var{ex}, @var{ly}, @var{uy} etc.,
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
44 ## depending on the plot type. Any number of argument sets may appear,
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
45 ## as long as they are separated with a format string @var{fmt}.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
46 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
47 ## If @var{y} is a matrix, @var{x} and error parameters must also be matrices
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
48 ## having same dimensions. The columns of @var{y} are plotted versus the
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
49 ## corresponding columns of @var{x} and errorbars are drawn from
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
50 ## the corresponding columns of error parameters.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
51 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
52 ## If @var{fmt} is missing, yerrorbars ("~") plot style
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
53 ## is assumed.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
54 ## If the @var{fmt} argument is supplied, it is interpreted as in
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
55 ## normal plots (See __pltopt__). In addition the following
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
56 ## plot styles are supported by errorbar:
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
57 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
58 ## @table @samp
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
59 ## @item ~
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
60 ## Set yerrorbars plot style (default).
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
61 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
62 ## @item >
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
63 ## Set xerrorbars plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
64 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
65 ## @item ~>
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
66 ## Set xyerrorbars plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
67 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
68 ## @item #
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
69 ## Set boxes plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
70 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
71 ## @item #~
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
72 ## Set boxerrorbars plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
73 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
74 ## @item #~>
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
75 ## Set boxxyerrorbars plot style.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
76 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
77 ## @end table
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
78 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
79 ## Examples:
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
80 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
81 ## @example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
82 ## errorbar(@var{x}, @var{y}, @var{ex}, ">")
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
83 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
84 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
85 ## xerrorbar plot of @var{y} versus @var{x} with @var{x} errorbars drawn from
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
86 ## @var{x}-@var{ex} to @var{x}+@var{ex}.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
87 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
88 ## @example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
89 ## errorbar(@var{x}, @var{y1}, @var{ey}, "~", @var{x}, @var{y2}, @var{ly}, @var{uy})
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
90 ## @end example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
91 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
92 ## Two yerrorbar plots with @var{y1} and @var{y2} versus @var{x}.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
93 ## 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
94 ## @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
95 ## @var{y2}+@var{uy}.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
96 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
97 ## @example
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
98 ## errorbar(@var{x}, @var{y}, @var{lx}, @var{ux}, @var{ly}, @var{uy}, "~>")
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
99 ## @end example
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 ## xyerrorbar plot of @var{y} versus @var{x} where @var{x} errorbars
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
102 ## are drawn from @var{x}-@var{lx} to @var{x}+@var{ux} and @var{y} errorbars
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
103 ## from @var{y}-@var{ly} to @var{y}+@var{uy}.
5642
2618a0750ae6 [project @ 2006-03-06 21:26:48 by jwe]
jwe
parents: 5307
diff changeset
104 ## @seealso{semilogx, semilogy, loglog, polar, mesh, contour, __pltopt__,
6448
2110cc251779 [project @ 2007-03-24 02:47:36 by jwe]
jwe
parents: 6257
diff changeset
105 ## bar, stairs, xlabel, ylabel, title}
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
106 ## @end deftypefn
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
107
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
108 ## Created: 18.7.2000
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
109 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
110 ## Keywords: errorbar, plotting
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
111
3979
e0b7a493e5a8 [project @ 2002-07-10 17:45:34 by jwe]
jwe
parents: 3718
diff changeset
112 function errorbar (varargin)
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
113
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6046
diff changeset
114 newplot ();
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
115
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6046
diff changeset
116 ## [h, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6046
diff changeset
117 h = gca ();
4007
31448e09d38e [project @ 2002-07-26 01:47:32 by jwe]
jwe
parents: 4006
diff changeset
118
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6046
diff changeset
119 __errcomm__ ("errorbar", h, varargin{:});
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
120
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
121 endfunction