minor grid in consecutive plots
9 views (last 30 days)
Show older comments
If I run the following code (within a script or command window) several times, then the minor grids will be 'on' only every other time. Why?
x=-2*pi:0.1:2*pi;
y=sin(x);
figure(1)
hold on
plot(x,y);
grid on
grid minor
0 Comments
Accepted Answer
Walter Roberson
on 9 Apr 2021
grid minor toggles the visibility of the minor grid lines. Minor grid lines lie between the tick marks. Not all types of charts support minor grid lines.
You probably want
set(gca, 'XMinorGrid', 'on', 'YMinorGrid', 'on')
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!