6052
|
1 ## Copyright (C) 2006 John W. Eaton |
|
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 2, or (at your option) |
|
8 ## 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, write to the Free |
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
|
19 |
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} box (@var{arg}) |
|
22 ## @deftypefnx {Function File} {} grid (@var{h}, @dots{}) |
|
23 ## Control the display of a border around the plot. |
|
24 ## The argument may be either @code{"on"} or @code{"off"}. If it is |
6653
|
25 ## omitted, the current box state is toggled. |
6052
|
26 ## @seealso{grid} |
|
27 ## @end deftypefn |
|
28 |
|
29 ## Author: jwe |
|
30 |
|
31 ## PKG_ADD: mark_as_command box |
|
32 |
6257
|
33 function box (varargin) |
|
34 |
|
35 h = gca (); |
|
36 |
|
37 box_state = get (h, "box"); |
|
38 |
|
39 nargs = numel (varargin); |
|
40 |
|
41 if (nargs == 0) |
|
42 if (strcmp (box_state, "on")) |
|
43 box_state = "off"; |
|
44 else |
|
45 box_state = "on"; |
|
46 endif |
|
47 elseif (nargs == 1) |
|
48 state = varargin{1}; |
|
49 if (ischar (state)) |
|
50 if (strcmp ("off", state)) |
|
51 box_state = "off"; |
|
52 elseif (strcmp ("on", state)) |
|
53 box_state = "on"; |
|
54 else |
|
55 print_usage (); |
|
56 endif |
|
57 endif |
|
58 else |
|
59 print_usage (); |
|
60 endif |
|
61 |
|
62 set (h, "box", box_state); |
6052
|
63 |
|
64 endfunction |