| Positioning the Axes The axes Position property enables you to define the location of the axes within the figure window. For example, h = axes('Position',position_rectangle) creates an axes object at the specified position within the current figure and returns a handle to it. Specify the location and size of the axes with a rectangle defined by a four-element vector, position_rectangle = [left, bottom, width, height]; The left and bottom elements of this vector define the distance from thelowerleftcornerofthefiguretothelowerleftcorneroftherectangle. The width and height elements define the dimensions of the rectangle. You specify these values in units determined by the Units property. By default, MATLAB uses normalized units where (0,0) is the lower left corner and (1.0,1.0) is the upper right corner of the figure window. You can define multiple axes in a single figure window: axes('position',[.1 .1 .8 .6]) mesh(peaks(20)); axes('position',[.1 .7 .8 .2]) pcolor([1:10;1:10]); In this example, the first plot occupies the bottom two-thirds of the figure, and the second occupies the top third. |