2303
|
1 ### Copyright (C) 1996 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, 59 Temple Place - Suite 330, Boston, MA |
|
18 ### 02111-1307, USA. |
245
|
19 |
4
|
20 function grid (x) |
|
21 |
2303
|
22 ## usage: grid ("on" | "off") |
|
23 ## |
|
24 ## Turn grid lines on or off for plotting. |
|
25 ## |
|
26 ## If the argument is omitted, "on" is assumed. |
|
27 ## |
|
28 ## See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, |
|
29 ## bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title |
4
|
30 |
|
31 if (nargin == 0) |
|
32 set grid; |
|
33 elseif (nargin == 1) |
|
34 if (isstr (x)) |
|
35 if (strcmp ("off", x)) |
|
36 set nogrid; |
|
37 elseif (strcmp ("on", x)) |
|
38 set grid; |
|
39 else |
904
|
40 usage ("grid (\"on\" | \"off\")"); |
4
|
41 endif |
|
42 else |
904
|
43 error ("grid: argument must be a string"); |
4
|
44 endif |
|
45 else |
|
46 error ("usage: grid (\"on\" | \"off\")"); |
|
47 endif |
|
48 |
|
49 endfunction |