Using MATLAB Graphics     Search    Help Desk 

Understanding Axes Aspect Ratio

Axes shape graphics objects by setting the scaling and limits of each axis. When you create a graph, MATLAB automatically determines axis scaling based on the values of the plotted data and then draws the axes to fit the space available for display. The definition of axes characteristics is controlled by axes graphics object properties. You can specify values for these properties to optimize each graph.

This section discusses MATLAB's default behavior as well as techniques for customizing graphs.

Stretch-to-Fill

By default, the size of the axes MATLAB creates for plotting is normalized to the size of the figure window (but is slightly smaller to allow for borders). If you resize the figure, the size and possibly the aspect ratio (the ratio of width to height) of the axis changes proportionally. This enables the axes to always fill the available space in the window. MATLAB also sets the x-, y-, and z-axis limits to provide the greatest resolution in each direction, again optimizing the use of available space.

This stretch-to-fill behavior is generally desirable; however, you may want to control this process to produce specific results. For example, images need to be displayed in correct proportions regardless of the aspect ratio of the figure window, or you may want graphs always to be a particular size on a printed page.



[ Previous | Help Desk | Next ]