Mercurial > hg > octave-nkf
annotate scripts/plot/__axes_limits__.m @ 8190:73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Oct 2008 21:06:05 -0400 |
parents | 5389a52df87b |
children | 7d48766c21a5 |
rev | line source |
---|---|
7050 | 1 ## Copyright (C) 2007 David Bateman |
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 | |
19 ## Undocumented internal function. | |
20 | |
21 function retval = __axes_limits__ (fcn, varargin) | |
7216 | 22 |
7050 | 23 retval = []; |
7216 | 24 |
25 fcnmode = sprintf ("%smode", fcn); | |
7050 | 26 |
7215 | 27 [h, varargin, nargin] = __plt_get_axis_arg__ (fcn, varargin{:}); |
7050 | 28 |
7215 | 29 if (nargin == 0) |
7050 | 30 retval = get (h, fcn); |
31 else | |
7215 | 32 arg = varargin{1}; |
7050 | 33 |
34 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
|
35 if (strcmpi (arg, "mode")) |
7050 | 36 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
|
37 elseif (strcmpi (arg, "auto") || strcmpi (arg, "manual")) |
7050 | 38 set (h, fcnmode, arg); |
39 endif | |
40 else | |
41 if (!isnumeric (arg) && any (size(arg(:)) != [2, 1])) | |
42 error ("%s: argument must be a 2 element vector", fcn); | |
43 else | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
44 set (h, fcn, arg(:)); |
7050 | 45 endif |
46 endif | |
47 endif | |
7216 | 48 |
7050 | 49 endfunction |