2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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, 59 Temple Place - Suite 330, Boston, MA |
|
18 ## 02111-1307, USA. |
1540
|
19 |
3368
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} plot_border (...) |
2311
|
22 ## Multiple arguments allowed to specify the sides on which the border |
3368
|
23 ## is shown. Allowed arguments include: |
3426
|
24 ## |
3368
|
25 ## @table @code |
|
26 ## @item "blank" |
|
27 ## No borders displayed. |
3426
|
28 ## |
3368
|
29 ## @item "all" |
|
30 ## All borders displayed |
3426
|
31 ## |
3368
|
32 ## @item "north" |
|
33 ## North Border |
3426
|
34 ## |
3368
|
35 ## @item "south" |
|
36 ## South Border |
3426
|
37 ## |
3368
|
38 ## @item "east" |
|
39 ## East Border |
3426
|
40 ## |
3368
|
41 ## @item "west" |
|
42 ## West Border |
|
43 ## @end table |
3426
|
44 ## |
3368
|
45 ## @noindent |
|
46 ## The arguments may be abbreviated to single characters. Without any |
|
47 ## arguments, @code{plot_border} turns borders off. |
|
48 ## @end deftypefn |
1540
|
49 |
2312
|
50 ## Author: Vinayak Dutt <Dutt.Vinayak@mayo.EDU> |
|
51 ## Created: 3 July 95 |
|
52 ## Adapted-By: jwe |
1540
|
53 |
3979
|
54 function plot_border (varargin) |
1540
|
55 |
|
56 south = 0; |
|
57 west = 0; |
|
58 north = 0; |
|
59 east = 0; |
|
60 all = 0; |
|
61 none = 1; |
|
62 |
3979
|
63 k = 1; |
1540
|
64 |
4717
|
65 nargs = nargin (); |
|
66 |
|
67 while (nargs--) |
1540
|
68 |
3979
|
69 arg = varargin{k++}; |
1540
|
70 |
|
71 if (! isstr (arg)) |
|
72 error ("plot_border: input not a string"); |
|
73 endif |
|
74 |
2303
|
75 ## The effect of the arguments in cumulative. If something is found |
|
76 ## after "b", do that and ignore "b". |
1540
|
77 |
|
78 if (strcmp (arg, "blank") || strcmp (arg, "BLANK") |
|
79 || strcmp (arg, "b") || strcmp (arg, "B")) |
|
80 none = 1; |
|
81 else |
|
82 none = 0; |
|
83 if (strcmp (arg, "south") || strcmp (arg, "SOUTH") |
3426
|
84 || strcmp (arg, "s") || strcmp (arg, "S")) |
|
85 south = 1; |
1540
|
86 elseif (strcmp (arg, "west") || strcmp (arg, "WEST") |
3426
|
87 || strcmp (arg, "w") || strcmp (arg, "W")) |
|
88 west = 2; |
1540
|
89 elseif (strcmp (arg, "north") || strcmp (arg, "NORTH") |
3426
|
90 || strcmp (arg, "n") || strcmp (arg, "N")) |
|
91 north = 4; |
1540
|
92 elseif (strcmp (arg, "east") || strcmp (arg, "EAST") |
3426
|
93 || strcmp (arg, "e") || strcmp (arg, "E")) |
|
94 east = 8; |
1540
|
95 elseif (strcmp (arg, "all") || strcmp (arg, "ALL") |
3426
|
96 || strcmp (arg, "a") || strcmp (arg, "A")) |
|
97 all = 1; |
1540
|
98 endif |
|
99 endif |
|
100 endwhile |
|
101 |
|
102 if (none) |
2520
|
103 gset noborder; |
1540
|
104 else |
|
105 if (all) |
|
106 border = 15; |
|
107 else |
|
108 border = south + west + north + east; |
|
109 endif |
2520
|
110 eval (sprintf ("gset border %d", border)); |
1540
|
111 endif |
|
112 |
|
113 endfunction |