MATLAB Creating Graphical User Interfaces

(ff) #1

f = figure;
ax = axes('Parent',f,'Position',[.15 .15 .7 .7]);


The first two arguments passed to the axes function, 'Parent',f specify the parent
container. In this case, the parent is a figure, but you can also specify the parent to be any
container, such as a panel or button group.


'Position',[.15 .15 .7 .7] specifies the location and size of the axes as a fraction
of the parent figure. In this case, the axes is 70 percent of the width of the figure and 70
percent of its height. The left edge of the axes is located at 15 percent of the figure’s
width from the left. The bottom of the axes is located 15 percent of the figure’s height
from the bottom. If the figure is resized, the axes retains its original proportions.


Add Components to a Programmatic App
Free download pdf