Mercurial > hg > octave-lyh
annotate scripts/plot/private/__axes_limits__.m @ 14112:6e9fee72a01c stable
Add missing ";" to line in waitbar.m demo.
author | Philip Nienhuis <prnienhuis@users.sf.net> |
---|---|
date | Tue, 27 Dec 2011 15:08:21 -0500 |
parents | eac43686d791 |
children | 72c96de7a403 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2007-2011 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 -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8190
diff
changeset
|
20 ## @deftypefn {Function File} {} __axes_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 |
24 function retval = __axes_limits__ (fcn, varargin) | |
7216 | 25 |
7050 | 26 retval = []; |
7216 | 27 |
28 fcnmode = sprintf ("%smode", fcn); | |
7050 | 29 |
7215 | 30 [h, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:}); |
7050 | 31 |
7215 | 32 if (nargin == 0) |
7050 | 33 retval = get (h, fcn); |
34 else | |
7215 | 35 arg = varargin{1}; |
7050 | 36 |
37 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
|
38 if (strcmpi (arg, "mode")) |
10549 | 39 retval = get (h, fcnmode); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
40 elseif (strcmpi (arg, "auto") || strcmpi (arg, "manual")) |
10549 | 41 set (h, fcnmode, arg); |
7050 | 42 endif |
43 else | |
44 if (!isnumeric (arg) && any (size(arg(:)) != [2, 1])) | |
10549 | 45 error ("%s: argument must be a 2 element vector", fcn); |
7050 | 46 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
|
47 if (arg(1) >= arg(2)) |
13744 | 48 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
|
49 else |
f7af3834405c
plot/private/__axis_limits__.m: Check lower axis limit come first.
Matthias Jüschke <matthias.jueschke@gmx.net>
parents:
11523
diff
changeset
|
50 set (h, fcn, arg(:)); |
f7af3834405c
plot/private/__axis_limits__.m: Check lower axis limit come first.
Matthias Jüschke <matthias.jueschke@gmx.net>
parents:
11523
diff
changeset
|
51 endif |
7050 | 52 endif |
53 endif | |
54 endif | |
7216 | 55 |
7050 | 56 endfunction |