next up previous contents
Next: HOLD Plot Hold Toggle Up: Plot Functions Previous: TITLE Plot Title Function   Contents

Subsections

GRID Plot Grid Toggle Function

Usage

Toggles the drawing of grid lines on the currently active plot. The general syntax for its use is

   grid(state)

where state is either

   grid('on')

to activate the grid lines, or

   grid('off')

to deactivate the grid lines.

Example

Here is a simple plot without grid lines.

--> x = linspace(-1,1);
--> y = cos(3*pi*x);
--> plot(x,y,'r-');

9056

Next, we activate the grid lines.

--> plot(x,y,'r-');
--> grid on

9059



Samit K. Basu 2005-03-16