Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

grid - Grid lines for 2-D and 3-D plots

GUI Alternative

To control the presence and appearance of grid lines on a graph, use the Property Editor, one of the plotting tools . For details, see The Property Editor in the MATLAB Graphics documentation.

Syntax

grid on
grid off
grid
grid(axes_handle,...)
grid minor

Description

The grid function turns the current axes' grid lines on and off.

grid on adds major grid lines to the current axes.

grid off removes major and minor grid lines from the current axes.

grid toggles the major grid visibility state.

grid(axes_handle,...) uses the axes specified by axes_handle instead of the current axes.

Algorithm

grid sets the XGrid, YGrid, and ZGrid properties of the axes.

grid minor sets the XMinorGrid, YMinorGrid, and ZMinorGrid properties of the axes.

You can set the grid lines for just one axis using the set command and the individual property. For example,

set(axes_handle,'XGrid','on')

turns on only x-axis grid lines.

You can set grid line width with the axes LineWidth property.

See Also

box, axes, set

The properties of axes objects

Axes Operations for related functions

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS