Add Components to a Programmatic UI
The first argument passed to uibuttongroup, f, specifies 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 another button group.
'Title','My Button Group' specifies a title to display on the button group.
'Position',[.1 .2 .8 .6] specifies the location and size of the button group as a
fraction of the parent container. In this case, the button group is 80 percent of the width
of the figure and 60 percent of its height. The left edge of the button group is located at
10 percent of the figure’s width from the left. The bottom of the button group is located 20
percent of the figure’s height from the bottom. If the figure is resized, the button group
retains its original proportions.
The following commands add two radio buttons to the button group. Setting the Units
property to 'normalized' causes the Position values to be interpreted as fractions of
the parent panel. Normalized units allow the buttons to retain their original relative
positions when the button group is resized.