Mercurial > octave-nkf
comparison scripts/plot/grid.m @ 5152:b111ca4715c6
[project @ 2005-02-21 19:41:23 by jwe]
author | jwe |
---|---|
date | Mon, 21 Feb 2005 19:41:23 +0000 |
parents | c08cb1098afc |
children | eecc24b92d97 |
comparison
equal
deleted
inserted
replaced
5151:b142b5a0d6be | 5152:b111ca4715c6 |
---|---|
33 | 33 |
34 function grid (x) | 34 function grid (x) |
35 | 35 |
36 usage_msg = "grid (\"on\" | \"off\")"; | 36 usage_msg = "grid (\"on\" | \"off\")"; |
37 | 37 |
38 do_replot = false; | |
39 | |
38 if (nargin == 0) | 40 if (nargin == 0) |
39 gset grid; | 41 gset grid; |
42 do_replot = true; | |
40 elseif (nargin == 1) | 43 elseif (nargin == 1) |
41 if (isstr (x)) | 44 if (isstr (x)) |
42 if (strcmp ("off", x)) | 45 if (strcmp ("off", x)) |
43 gset nogrid; | 46 gset nogrid; |
47 do_replot = true; | |
44 elseif (strcmp ("on", x)) | 48 elseif (strcmp ("on", x)) |
45 gset grid; | 49 gset grid; |
50 do_replot = true; | |
46 else | 51 else |
47 usage (usage_msg); | 52 usage (usage_msg); |
48 endif | 53 endif |
49 else | 54 else |
50 error ("grid: argument must be a string"); | 55 error ("grid: argument must be a string"); |
51 endif | 56 endif |
52 else | 57 else |
53 usage (usage_msg); | 58 usage (usage_msg); |
54 endif | 59 endif |
55 | 60 |
61 if (do_replot && automatic_replot) | |
62 replot | |
63 endif | |
64 | |
56 endfunction | 65 endfunction |