annotate scripts/plot/draw/semilogxerr.m @ 20737:2d9ec16fa960

Print error, rather than aborting, if mex function mxIsFromGlobalWS is used (bug #46070). * mex.cc (mxIsFromGlobalWS): Call mexErrMsgTxt rather than abort() in function.
author Rik <rik@octave.org>
date Tue, 29 Sep 2015 12:00:11 -0700
parents 905fc6b85b4c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19898
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 18415
diff changeset
1 ## Copyright (C) 2000-2015 Teemu Ikonen
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
2 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
4 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
5 ## 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
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.
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
9 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
10 ## 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
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
14 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 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/>.
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
18
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
18415
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
20 ## @deftypefn {Function File} {} semilogxerr (@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} {} semilogxerr (@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} {} semilogxerr (@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} {} semilogxerr (@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} {} semilogxerr (@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} {} semilogxerr (@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} {} semilogxerr (@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} {} semilogxerr (@var{x1}, @var{y1}, @dots{}, @var{fmt}, @var{xn}, @var{yn}, @dots{})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
28 ## @deftypefnx {Function File} {} semilogxerr (@var{hax}, @dots{})
238aa26b30e3 doc: Re-write documentation for errorbar family of functions.
Rik <rik@octave.org>
parents: 17744
diff changeset
29 ## @deftypefnx {Function File} {@var{h} =} semilogxerr (@dots{})
20383
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19898
diff changeset
30 ## Produce 2-D plots using a logarithmic scale for the x-axis and errorbars
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19898
diff changeset
31 ## at each data point.
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
32 ##
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
33 ## Many different combinations of arguments are possible. The most common
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
34 ## form is
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
35 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
36 ## @example
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
37 ## semilogxerr (@var{x}, @var{y}, @var{ey}, @var{fmt})
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
38 ## @end example
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
39 ##
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
40 ## @noindent
10687
a8ce6bdecce5 Improve documentation strings.
Rik <octave@nomad.inbox5.com>
parents: 10595
diff changeset
41 ## which produces a semi-logarithmic plot of @var{y} versus @var{x}
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
42 ## with errors in the @var{y}-scale defined by @var{ey} and the plot
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17082
diff changeset
43 ## format defined by @var{fmt}. @xref{XREFerrorbar,,errorbar}, for available
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17082
diff changeset
44 ## formats and additional information.
17161
52931d71400f doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents: 17126
diff changeset
45 ##
52931d71400f doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents: 17126
diff changeset
46 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
52931d71400f doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents: 17126
diff changeset
47 ## rather than the current axes returned by @code{gca}.
52931d71400f doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents: 17126
diff changeset
48 ##
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
49 ## @seealso{errorbar, semilogyerr, loglogerr}
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
50 ## @end deftypefn
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
51
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
52 ## Created: 20.2.2001
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
53 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
54 ## Keywords: errorbar, plotting
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
55
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
56 function h = semilogxerr (varargin)
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
57
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
58 [hax, varargin] = __plt_get_axis_arg__ ("semilogxerr", varargin{:});
7216
5389a52df87b [project @ 2007-11-29 19:07:29 by jwe]
jwe
parents: 7207
diff changeset
59
17211
87ba70043bfc Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents: 17190
diff changeset
60 oldfig = [];
17301
68bcac3c043a Correct inversion accidentally introduced in cset 87ba70043bfc.
Rik <rik@octave.org>
parents: 17211
diff changeset
61 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
62 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
63 endif
7207
71c03c7239fb [project @ 2007-11-28 02:19:25 by jwe]
jwe
parents: 7017
diff changeset
64 unwind_protect
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
65 hax = newplot (hax);
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
66
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
67 set (hax, "xscale", "log");
17082
cb8543396024 Set minorticks for error bar plots with logarithmic axes.
Rik <rik@octave.org>
parents: 17057
diff changeset
68 if (! ishold (hax))
cb8543396024 Set minorticks for error bar plots with logarithmic axes.
Rik <rik@octave.org>
parents: 17057
diff changeset
69 set (hax, "xminortick", "on");
cb8543396024 Set minorticks for error bar plots with logarithmic axes.
Rik <rik@octave.org>
parents: 17057
diff changeset
70 endif
17126
26589abbc78d Don't pass axis handle unnecessarily from high level to low level plot functions.
Rik <rik@octave.org>
parents: 17122
diff changeset
71
20611
905fc6b85b4c build: Consolidate __errcomm__.m and __errplot__.m to one file.
Rik <rik@octave.org>
parents: 20383
diff changeset
72 htmp = __errplot__ ("semilogxerr", hax, varargin{:});
17082
cb8543396024 Set minorticks for error bar plots with logarithmic axes.
Rik <rik@octave.org>
parents: 17057
diff changeset
73
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
74 unwind_protect_cleanup
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
75 if (! isempty (oldfig))
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
76 set (0, "currentfigure", oldfig);
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
77 endif
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
78 end_unwind_protect
6302
a5cd8b77e892 [project @ 2007-02-13 08:08:33 by jwe]
jwe
parents: 6257
diff changeset
79
17057
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
80 if (nargout > 0)
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
81 h = htmp;
abf6a6147f1a loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 16814
diff changeset
82 endif
4019
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
83
c6d7ae9fcdb9 [project @ 2002-08-05 16:42:36 by jwe]
jwe
parents:
diff changeset
84 endfunction
10595
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
85
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
86
10595
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
87 %!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
88 %! clf;
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14245
diff changeset
89 %! x = exp (log (0.01):0.2:log (10));
10595
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
90 %! y = wblpdf (x, 2, 2);
46c8ecc4d565 Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents: 9245
diff changeset
91 %! ey = 0.5*rand (size (y)) .* y;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
92 %! semilogxerr (x, y, ey, '#~x-');
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
93 %! xlim (x([1, end]));
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17161
diff changeset
94 %! title ({'semilogxerr(): semilogx() plot with errorbars', ...
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17161
diff changeset
95 %! 'X-axis is logarithmic'});
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
96