Graphics    

Setting Aspect Ratio

By default, MATLAB displays graphs in a rectangular axes that has the same aspect ratio as the figure window. This makes optimum use of space available for plotting. MATLAB provides control over the aspect ratio with the axis command.

For example,

produces a graph with the default aspect ratio. The command

makes the x- and y-axes equal in length.

The square axes has one data unit in x to equal two data units in y. If you want the x- and y-data units to be equal, use the command

This produces an axes that is rectangular in shape, but has equal scaling along each axis.

If you want the axes shape to conform to the plotted data, use the tight option in conjunction with equal.


  Example - Specifying Ticks and Tick Labels Figure Windows