Mercurial > octave
annotate scripts/plot/draw/loglogerr.m @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
1 ## Copyright (C) 2000-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
2 ## |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
5 ## |
4019 | 6 ## |
7 ## This file is part of Octave. | |
8 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24432
diff
changeset
|
9 ## Octave is free software: you can redistribute it and/or modify it |
4019 | 10 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24432
diff
changeset
|
11 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22367
diff
changeset
|
12 ## (at your option) any later version. |
4019 | 13 ## |
14 ## Octave is distributed in the hope that it will be useful, but | |
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22367
diff
changeset
|
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22367
diff
changeset
|
17 ## GNU General Public License for more details. |
4019 | 18 ## |
19 ## You should have received a copy of the GNU General Public License | |
7016 | 20 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24432
diff
changeset
|
21 ## <https://www.gnu.org/licenses/>. |
4019 | 22 |
23 ## -*- texinfo -*- | |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
24 ## @deftypefn {} {} loglogerr (@var{y}, @var{ey}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
25 ## @deftypefnx {} {} loglogerr (@var{y}, @dots{}, @var{fmt}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
26 ## @deftypefnx {} {} loglogerr (@var{x}, @var{y}, @var{ey}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
27 ## @deftypefnx {} {} loglogerr (@var{x}, @var{y}, @var{err}, @var{fmt}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
28 ## @deftypefnx {} {} loglogerr (@var{x}, @var{y}, @var{lerr}, @var{uerr}, @var{fmt}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
29 ## @deftypefnx {} {} loglogerr (@var{x}, @var{y}, @var{ex}, @var{ey}, @var{fmt}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
30 ## @deftypefnx {} {} loglogerr (@var{x}, @var{y}, @var{lx}, @var{ux}, @var{ly}, @var{uy}, @var{fmt}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
31 ## @deftypefnx {} {} loglogerr (@var{x1}, @var{y1}, @dots{}, @var{fmt}, @var{xn}, @var{yn}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
32 ## @deftypefnx {} {} loglogerr (@var{hax}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20401
diff
changeset
|
33 ## @deftypefnx {} {@var{h} =} loglogerr (@dots{}) |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17082
diff
changeset
|
34 ## Produce 2-D plots on a double logarithm axis with errorbars. |
17057
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
35 ## |
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
36 ## 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
|
37 ## form is |
4019 | 38 ## |
39 ## @example | |
40 ## loglogerr (@var{x}, @var{y}, @var{ey}, @var{fmt}) | |
41 ## @end example | |
42 ## | |
43 ## @noindent | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
44 ## which produces a double logarithm plot of @var{y} versus @var{x} |
4019 | 45 ## 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
|
46 ## 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
|
47 ## 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:
17122
diff
changeset
|
48 ## |
24431
0c6cedafc71e
doc: Use 'axes' rather than 'axis' appropriately in docstrings.
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
49 ## If the first argument @var{hax} is an axes handle, then plot into this axes, |
17161
52931d71400f
doc: Document that first argument can be an axes handle for several plot functions.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
50 ## rather than the current axes returned by @code{gca}. |
6895 | 51 ## @seealso{errorbar, semilogxerr, semilogyerr} |
4019 | 52 ## @end deftypefn |
53 | |
54 ## Created: 20.2.2001 | |
55 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> | |
56 ## Keywords: errorbar, plotting | |
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 function h = loglogerr (varargin) |
4019 | 59 |
17057
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
60 [hax, varargin] = __plt_get_axis_arg__ ("loglogerr", varargin{:}); |
7216 | 61 |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
62 oldfig = []; |
17301
68bcac3c043a
Correct inversion accidentally introduced in cset 87ba70043bfc.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
63 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
|
64 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
|
65 endif |
7207 | 66 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
|
67 hax = newplot (hax); |
4019 | 68 |
17057
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
69 set (hax, "xscale", "log", "yscale", "log"); |
22367
459545bc9019
Use ishold () rather than ishold (hax) for performance.
Rik <rik@octave.org>
parents:
22366
diff
changeset
|
70 if (! ishold ()) |
22366
837df5db5710
Make graphic functions visually compatible w/Matlab.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
71 set (hax, "xminortick", "on", "yminortick", "on", "box", "on"); |
17082
cb8543396024
Set minorticks for error bar plots with logarithmic axes.
Rik <rik@octave.org>
parents:
17057
diff
changeset
|
72 endif |
20401
905fc6b85b4c
build: Consolidate __errcomm__.m and __errplot__.m to one file.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
73 htmp = __errplot__ ("loglogerr", hax, varargin{:}); |
17082
cb8543396024
Set minorticks for error bar plots with logarithmic axes.
Rik <rik@octave.org>
parents:
17057
diff
changeset
|
74 |
17057
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
75 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
|
76 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
|
77 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
|
78 endif |
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
79 end_unwind_protect |
6302 | 80 |
17057
abf6a6147f1a
loglogerr.m, semilogyerr.m, semilogxerr.m: Update to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
81 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
|
82 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
|
83 endif |
4019 | 84 |
85 endfunction | |
10595
46c8ecc4d565
Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
86 |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
87 |
10595
46c8ecc4d565
Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
88 %!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
|
89 %! clf; |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
90 %! x = exp (log (0.01):0.2:log (10)); |
24711
752f61e812f4
Fix XXXerr plot demos which rely on wblpdf (bug #53072).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
91 %! wblpdf = @(x, scl, shp) shp*(scl^-shp) .* x.^(shp-1) .* exp (-(x/scl).^shp); |
10595
46c8ecc4d565
Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
92 %! y = wblpdf (x, 3, 2); |
46c8ecc4d565
Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
93 %! eyu = 2*rand (size (y)) .* y; |
46c8ecc4d565
Add demos to loglogerr.m, semilogxerr.m, & semilogyerr.m
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
94 %! eyl = 0.5*rand (size (y)) .* y; |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
95 %! loglogerr (x, y, eyl, eyu, "#~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
|
96 %! xlim (x([1, end])); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
97 %! title ({"loglogerr(): loglog() plot with errorbars", ... |
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
98 %! "Both axes are logarithmic"}); |