Getting Started Previous page   Next Page

Controlling the Axes

The axis command provides a number of options for setting the scaling, orientation, and aspect ratio of graphs. 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 and chooses 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-axis and y-axis the same length:

makes the individual tick mark increments on the x-axes 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 axes visible. This is the default.

makes the axes 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.


Previous page  Multiple Plots in One Figure Axis Labels and Titles Next page

© 1994-2005 The MathWorks, Inc.