Getting Started    

Controlling the Axes

The axis command supports a number of options for setting the scaling, orientation, and aspect ratio of plots. You can also set these options interactively. See Editing Plots for more information.

Setting Axis Limits

By default, MATLAB finds the maxima and minima of the data to choose the axis limits to span this range. The axis command enables you to specify your own limits

or for three-dimensional graphs,

Use the command

to reenable MATLAB automatic limit selection.

Setting Axis Aspect Ratio

axis also enables you to specify a number of predefined modes. For example,

makes the x-axes and y-axes the same length.

makes the individual tick mark increments on the x- and y-axes the same length. This means

followed by either axis square or axis equal turns the oval into a proper circle.

returns the axis scaling to its default, automatic mode.

Setting Axis Visibility

You can use the axis command to make the axis visible or invisible.

makes the axis visible. This is the default.

makes the axis invisible.

Setting Grid Lines

The grid command toggles grid lines on and off. The statement

turns the grid lines on and

turns them back off again.


  Multiple Plots in One Figure Axis Labels and Titles