%% Display Major and Minor Grid Lines
% This example shows how to display major and minor grid lines on a graph. Major grid lines align with the tick mark locations. Minor grid lines appear between the tick marks.
% Use grid on to display the major grid lines.

x = -10:10;
y = x.^2;

figure
plot(x,y)
grid on

%
% Use grid minor to display the minor grid lines.

grid minor

%
% Use grid off to remove the grid lines.

grid off

% Copyright 2015 The MathWorks, Inc.