23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

While the basic purpose of an axes object is to provide a coordinate system for<br />

plotted data, axes properties provide considerable control over the way<br />

<strong>MATLAB</strong> displays data.<br />

Stretch-to-Fill<br />

By default, <strong>MATLAB</strong> stretches the axes to fill the axes position rectangle (the<br />

rectangle defined by the last two elements in the Position property). This<br />

results in graphs that use the available space in the rectangle. However, some<br />

3-D graphs (such as a sphere) appear distorted because of this stretching, and<br />

are better viewed with a specific three-dimensional aspect ratio.<br />

Stretch-to-fill is active when the DataAspectRatioMode,<br />

PlotBoxAspectRatioMode, and CameraViewAngleMode are all auto (the<br />

default). However, stretch-to-fill is turned off when the DataAspectRatio,<br />

PlotBoxAspectRatio, or CameraViewAngle is user-specified, or when one or<br />

more of the corresponding modes is set to manual (which happens<br />

automatically when you set the corresponding property value).<br />

This picture shows the same sphere displayed both with and without the<br />

stretch-to-fill. The dotted lines show the axes Position rectangle.<br />

1<br />

8<br />

6<br />

4<br />

2<br />

0<br />

2<br />

4<br />

6<br />

8<br />

1<br />

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1<br />

Stretch-to-fill active<br />

−1<br />

−1 −0.5 0 0.5 1<br />

When stretch-to-fill is disabled, <strong>MATLAB</strong> sets the size of the axes to be as large<br />

as possible within the constraints imposed by the Position rectangle without<br />

introducing distortion. In the picture above, the height of the rectangle<br />

constrains the axes size.<br />

1<br />

0.8<br />

0.6<br />

0.4<br />

0.2<br />

0<br />

−0.2<br />

−0.4<br />

−0.6<br />

−0.8<br />

Stretch-to-fill disabled<br />

axes<br />

2-85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!