annotate scripts/plot/semilogxerr.m @ 10595:46c8ecc4d565

Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
author Ben Abbott <bpabbott@mac.com>
date Fri, 30 Apr 2010 19:08:55 -0400
parents 16f53d29049f
children a8ce6bdecce5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9245
16f53d29049f update copyright notices
John W. Eaton <jwe@octave.org>
parents: 9040
diff changeset
1 ## Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2009
16f53d29049f update copyright notices
John W. Eaton <jwe@octave.org>
parents: 9040
diff changeset
2 ## Teemu Ikonen
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
3 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
4 ## This file is part of Octave.
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
5 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
6 ## Octave is free software; you can redistribute it and/or modify it
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
7 ## 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
8 ## 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
9 ## your option) any later version.
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
10 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
11 ## Octave is distributed in the hope that it will be useful, but
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
14 ## General Public License for more details.
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
15 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
16 ## 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
17 ## 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
18 ## <http://www.gnu.org/licenses/>.
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
19
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
20 ## -*- texinfo -*-
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
21 ## @deftypefn {Function File} {} semilogxerr (@var{args})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6448
diff changeset
22 ## Produce two-dimensional plots on a semilogarithm axis with errorbars.
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6448
diff changeset
23 ## Many different combinations of arguments are possible. The most used
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6448
diff changeset
24 ## form is
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
25 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
26 ## @example
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
27 ## semilogxerr (@var{x}, @var{y}, @var{ey}, @var{fmt})
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
28 ## @end example
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
29 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
30 ## @noindent
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
31 ## which produces a semi-logarithm plot of @var{y} versus @var{x}
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
32 ## with errors in the @var{y}-scale defined by @var{ey} and the plot
9040
dbd0c77e575e Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents: 7216
diff changeset
33 ## format defined by @var{fmt}. See errorbar for available formats and
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
34 ## additional information.
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6448
diff changeset
35 ## @seealso{errorbar, loglogerr semilogyerr}
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
36 ## @end deftypefn
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
37
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
38 ## Created: 20.2.2001
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
39 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
40 ## Keywords: errorbar, plotting
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
41
6302
a5cd8b77e892 [project @ 2007-02-13 08:08:33 by jwe]
jwe
parents: 6257
diff changeset
42 function retval = semilogxerr (varargin)
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
43
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
44 [h, varargin] = __plt_get_axis_arg__ ("semilogxerr", varargin{:});
7216
5389a52df87b [project @ 2007-11-29 19:07:29 by jwe]
jwe
parents: 7207
diff changeset
45
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
46 oldh = gca ();
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
47 unwind_protect
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
48 axes (h);
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
49 newplot ();
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
50
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
51 set (h, "xscale", "log");
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
52
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
53 tmp = __errcomm__ ("semilogxerr", h, varargin{:});
6302
a5cd8b77e892 [project @ 2007-02-13 08:08:33 by jwe]
jwe
parents: 6257
diff changeset
54
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
55 if (nargout > 0)
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
56 retval = tmp;
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
57 endif
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
58 unwind_protect_cleanup
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
59 axes (oldh);
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
60 end_unwind_protect
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
61
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
62 endfunction
10595
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
63
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
64 %!demo
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
65 %! x = exp (log(0.01):0.2:log(10));
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
66 %! y = wblpdf (x, 2, 2);
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
67 %! ey = 0.5*rand (size (y)) .* y;
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
68 %! semilogxerr (x, y, ey, "#~x-")
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
69 %! xlim (x([1, end]))