Mercurial > octave-nkf
annotate scripts/plot/appearance/private/__axis_limits__.m @ 17574:662db69503b4
__axis_limits__.m: Change function prototype to match file name.
* scripts/plot/appearance/private/__axis_limits__: Change function prototype
to match file name.m
author | Rik <rik@octave.org> |
---|---|
date | Fri, 04 Oct 2013 19:10:10 -0700 |
parents | 7bb76a22cde1 |
children | d63878346099 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13744
diff
changeset
|
1 ## Copyright (C) 2007-2012 David Bateman |
7050 | 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 | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
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 | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8190
diff
changeset
|
19 ## -*- texinfo -*- |
17574
662db69503b4
__axis_limits__.m: Change function prototype to match file name.
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
20 ## @deftypefn {Function File} {} __axis_limits__ (@var{fcn}, @dots{}) |
7050 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8190
diff
changeset
|
22 ## @end deftypefn |
7050 | 23 |
17574
662db69503b4
__axis_limits__.m: Change function prototype to match file name.
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
24 function retval = __axis_limits__ (fcn, varargin) |
7216 | 25 |
17044
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
26 [hax, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:}); |
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
27 |
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
28 if (isempty (hax)) |
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
29 hax = gca (); |
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
30 endif |
7050 | 31 |
7215 | 32 if (nargin == 0) |
17044
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
33 retval = get (hax, fcn); |
7050 | 34 else |
17156
1748182db458
__axes_limits__.m: Update code to modern conventions.
Rik <rik@octave.org>
parents:
17044
diff
changeset
|
35 retval = []; |
1748182db458
__axes_limits__.m: Update code to modern conventions.
Rik <rik@octave.org>
parents:
17044
diff
changeset
|
36 fcnmode = [fcn "mode"]; |
7215 | 37 arg = varargin{1}; |
7050 | 38 if (ischar (arg)) |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
39 if (strcmpi (arg, "mode")) |
17044
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
40 retval = get (hax, fcnmode); |
17156
1748182db458
__axes_limits__.m: Update code to modern conventions.
Rik <rik@octave.org>
parents:
17044
diff
changeset
|
41 elseif (any (strcmpi (arg, {"auto", "manual"}))) |
17044
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
42 set (hax, fcnmode, arg); |
7050 | 43 endif |
44 else | |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
45 if (!isnumeric (arg) && any (size (arg(:)) != [2, 1])) |
17156
1748182db458
__axes_limits__.m: Update code to modern conventions.
Rik <rik@octave.org>
parents:
17044
diff
changeset
|
46 error ("%s: LIMITS must be a 2-element vector", fcn); |
7050 | 47 else |
13037
f7af3834405c
plot/private/__axis_limits__.m: Check lower axis limit come first.
Matthias Jüschke <matthias.jueschke@gmx.net>
parents:
11523
diff
changeset
|
48 if (arg(1) >= arg(2)) |
13744 | 49 error ("%s: axis limits must be increasing", fcn); |
13037
f7af3834405c
plot/private/__axis_limits__.m: Check lower axis limit come first.
Matthias Jüschke <matthias.jueschke@gmx.net>
parents:
11523
diff
changeset
|
50 else |
17044
cec8c423b3e8
__axes_limits__.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
51 set (hax, fcn, arg(:)); |
13037
f7af3834405c
plot/private/__axis_limits__.m: Check lower axis limit come first.
Matthias Jüschke <matthias.jueschke@gmx.net>
parents:
11523
diff
changeset
|
52 endif |
7050 | 53 endif |
54 endif | |
55 endif | |
7216 | 56 |
7050 | 57 endfunction |
17156
1748182db458
__axes_limits__.m: Update code to modern conventions.
Rik <rik@octave.org>
parents:
17044
diff
changeset
|
58 |