"Matlab: Grid"

Matlab plot with X and Y grid

To add X and Y grids to plots :

grid on;

Matlab plot with Y grid only

To add Y only grid:

set(gca,'XGrid','off','YGrid','on');

Matlab plot with X grid only

To add X only grid

set(gca,'XGrid','on','YGrid',’off');

social