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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

axes<br />

Examples Zooming<br />

2-86<br />

Zoom in using aspect ratio and limits:<br />

sphere<br />

set(gca,'DataAspectRatio',[1 1 1],...<br />

'PlotBoxAspectRatio',[1 1 1],'ZLim',[−0.6 0.6])<br />

Zoom in and out using the CameraViewAngle:<br />

sphere<br />

set(gca,'CameraViewAngle',get(gca,'CameraViewAngle')−5)<br />

set(gca,'CameraViewAngle',get(gca,'CameraViewAngle')+5)<br />

Note that both examples disable <strong>MATLAB</strong>’s stretch-to-fill behavior.<br />

Positioning the Axes<br />

The axes Position property enables you to define the location of the axes<br />

within the figure window. For example,<br />

h = axes('Position',position_rectangle)<br />

creates an axes object at the specified position within the current figure and<br />

returns a handle to it. Specify the location and size of the axes with a rectangle<br />

defined by a four-element vector,<br />

position_rectangle = [left, bottom, width, height];<br />

The left and bottom elements of this vector define the distance from the<br />

lower-left corner of the figure to the lower-left corner of the rectangle. The<br />

width and height elements define the dimensions of the rectangle. You specify<br />

these values in units determined by the Units property. By default, <strong>MATLAB</strong><br />

uses normalized units where (0,0) is the lower-left corner and (1.0,1.0) is the<br />

upper-right corner of the figure window.<br />

You can define multiple axes in a single figure window:<br />

axes('position',[.1 .1 .8 .6])<br />

mesh(peaks(20));<br />

axes('position',[.1 .7 .8 .2])<br />

pcolor([1:10;1:10]);

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

Saved successfully!

Ooh no, something went wrong!