Mercurial > octave-nkf
annotate scripts/plot/appearance/grid.m @ 18927:fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
For Matlab compatibility, turn off major grid on log scale axes when minor
grid is also on.
* grid.m: Use '-' linestyle for major axis grid when minor grid is on.
For Matlab compatibility, turn off major grid on log scale axes when minor
grid is also on. Add new %!demo to show behavior.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 03 Jul 2014 14:10:35 -0700 |
parents | d63878346099 |
children | 0e1f5a750d00 |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17572
diff
changeset
|
1 ## Copyright (C) 1993-2013 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
2313 | 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 | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
245 | 18 |
3368 | 19 ## -*- texinfo -*- |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
20 ## @deftypefn {Command} {} grid |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
21 ## @deftypefnx {Command} {} grid on |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
22 ## @deftypefnx {Command} {} grid off |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
23 ## @deftypefnx {Command} {} grid minor |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
24 ## @deftypefnx {Command} {} grid minor on |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
25 ## @deftypefnx {Command} {} grid minor off |
8528 | 26 ## @deftypefnx {Function File} {} grid (@var{hax}, @dots{}) |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
27 ## Control the display of plot grid lines. |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
28 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
29 ## The function state input may be either @qcode{"on"} or @qcode{"off"}. |
8528 | 30 ## If it is omitted, the current grid state is toggled. |
5727 | 31 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
32 ## When the first argument is @qcode{"minor"} all subsequent commands |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
33 ## modify the minor grid rather than the major grid. |
8528 | 34 ## |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
35 ## If the first argument @var{hax} is an axes handle, then operate on |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
36 ## this axis rather than the current axes returned by @code{gca}. |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
37 ## |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
38 ## To control the grid lines for an individual axis use the @code{set} |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
39 ## function. For example: |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
40 ## |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
41 ## @example |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
42 ## set (gca, "ygrid", "on"); |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
43 ## @end example |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17085
diff
changeset
|
44 ## @seealso{axis, box} |
3368 | 45 ## @end deftypefn |
4 | 46 |
2314 | 47 ## Author: jwe |
48 | |
7215 | 49 function grid (varargin) |
5727 | 50 |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
51 [hax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:}); |
6257 | 52 |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
53 if (isempty (hax)) |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
54 hax = gca (); |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
55 endif |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
56 |
8424
a84d71abdc5b
grid.m: handle minor grid option
Doug Stewart <dastew@sympatico.ca>
parents:
8190
diff
changeset
|
57 if (nargs > 2) |
7215 | 58 print_usage (); |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
59 endif |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
60 |
18927
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
61 grid_on = any (strcmp (get (hax, {"xgrid", "ygrid", "zgrid"}), "on")); |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
62 |
18927
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 minor_on = any (strcmp (get (hax, {"xminorgrid", "yminorgrid", "zminorgrid"}), |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 "on")); |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
65 |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
66 minor_auto = true; |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
67 if (nargs == 0) |
7215 | 68 grid_on = ! grid_on; |
6257 | 69 else |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
70 arg1 = varargin{1}; |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
71 if (! ischar (arg1)) |
17085
d3ebc3f9bdbf
doc update for grid and subplot
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17049
diff
changeset
|
72 error ("grid: argument 1 must be an axis handle or a string"); |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
73 endif |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
74 if (strcmpi (arg1, "off")) |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
75 grid_on = false; |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
76 elseif (strcmpi (arg1, "on")) |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
77 grid_on = true; |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
78 elseif (strcmpi (arg1, "minor")) |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
79 minor_auto = false; |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
80 if (nargs == 2) |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
81 arg2 = varargin{2}; |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
82 if (strcmpi (arg2, "on")) |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
83 minor_on = true; |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
84 grid_on = true; |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
85 elseif (strcmpi (arg2, "off")) |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
86 minor_on = false; |
10549 | 87 else |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
88 print_usage (); |
10549 | 89 endif |
4 | 90 else |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
91 minor_on = ! minor_on; |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
92 if (minor_on) |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
93 grid_on = true; |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
94 endif |
4 | 95 endif |
96 else | |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
97 print_usage (); |
4 | 98 endif |
6257 | 99 endif |
100 | |
101 if (grid_on) | |
18927
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
102 set (hax, "xgrid", "on", "ygrid", "on", "zgrid", "on", |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
103 "gridlinestyle", ":"); |
6257 | 104 if (minor_on) |
18927
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
105 set (hax, "xminorgrid", "on", "yminorgrid", "on", "zminorgrid", "on", |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
106 "gridlinestyle", "-", "minorgridlinestyle", ":"); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
107 xg = ifelse (strcmp (get (hax, "xscale"), "log"), "off", "on"); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
108 yg = ifelse (strcmp (get (hax, "yscale"), "log"), "off", "on"); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
109 zg = ifelse (strcmp (get (hax, "zscale"), "log"), "off", "on"); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
110 set (hax, "xgrid", xg, "ygrid", yg, "zgrid", zg); |
17520
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
111 elseif (minor_auto) |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
112 xmg = ifelse (strcmp (get (hax, "xscale"), "log"), "on", "off"); |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
113 ymg = ifelse (strcmp (get (hax, "yscale"), "log"), "on", "off"); |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
114 zmg = ifelse (strcmp (get (hax, "zscale"), "log"), "on", "off"); |
8a303b01cdd0
grid.m: 'grid on' now also turns on minor grid for log scale axes.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
115 set (hax, "xminorgrid", xmg, "yminorgrid", ymg, "zminorgrid", zmg); |
5727 | 116 else |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
117 set (hax, "xminorgrid", "off", "yminorgrid", "off", "zminorgrid", "off"); |
6257 | 118 endif |
4 | 119 else |
17049
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
120 set (hax, "xgrid", "off", "ygrid", "off", "zgrid", "off", |
0322e057697f
hold.m, grid.m, box.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14245
diff
changeset
|
121 "xminorgrid", "off", "yminorgrid", "off", "zminorgrid", "off"); |
5152 | 122 endif |
123 | |
4 | 124 endfunction |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
125 |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
126 |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
127 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
128 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
129 %! subplot (2,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
130 %! plot (1:100); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
131 %! grid off; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
132 %! title ('no grid'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
133 %! subplot (2,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
134 %! plot (1:100); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
135 %! grid on; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
136 %! title ('grid on'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
137 %! subplot (2,2,3); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
138 %! plot (1:100); |
18927
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
139 %! grid off; |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
140 %! title ('no grid'); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
141 %! subplot (2,2,4); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
142 %! plot (1:100); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
143 %! grid minor; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
144 %! title ('grid minor'); |
18927
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
145 |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
146 %!demo |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
147 %! subplot (2,2,1); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
148 %! semilogy (1:100); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
149 %! grid off; |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
150 %! title ('no grid'); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
151 %! subplot (2,2,2); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
152 %! semilogy (1:100); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
153 %! grid on; |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
154 %! title ('grid on'); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
155 %! subplot (2,2,3); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
156 %! semilogy (1:100); |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
157 %! grid off; |
fee51895ffe1
grid.m: Use '-' linestyle for major axis grid when minor grid is on.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
158 %! title ('no grid'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
159 %! subplot (2,2,4); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
160 %! semilogy (1:100); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
161 %! grid minor; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
162 %! title ('grid minor'); |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
163 |