Documentation Center

  • Trials
  • Product Updates

Axes Position

Introduction

The axes Position property controls the size and location of an axes within a figure. The default axes has the same aspect ratio (ratio of width to height) as the default figure and fills most of the figure, leaving a border around the edges. However, you can define the axes position as any rectangle and place it wherever you want within a figure.

The Position Vector

MATLAB® defines the axes Position property as a vector.

[left bottom width height]

left and bottom define a point in the figure that locates the lower left corner of the axes rectangle. width and height specify the dimensions of the axes rectangle. Viewing the axes in 2-D (azimuth = 0°, elevation = 90°) orients the x-axis horizontally and the y-axis vertically. From this angle, the plot box (the area used for plotting, exclusive of the axis labels) coincides with the axes rectangle.

By default, MATLAB draws the plot box to fill the axes rectangle, regardless of its shape. However, axes properties enable control over the shape and scaling of the plot box.

Position Units

The axes Units property determines the units of measurement for the Position property. Possible values for this property are

set(gca,'Units')
[ inches | centimeters | {normalized} | points | pixels ]

with normalized being the default. Normalized units map the lower left corner of the figure to the point (0,0) and the upper right corner to (1.0,1.0), regardless of the size of the figure. Normalized units cause axes to resize automatically whenever you resize the figure. All other units are absolute measurements that remained fixed as you resize the figure.

Was this topic helpful?