User`s guide
Graphics and 3-D Visualization
19-31
annotation function, it can grow or shrink to just fit the text you type into it. This
behavior is controlled by the Annotation Textbox object's FitBoxToText property, which
can be 'on' or 'off'. When you create a textbox with the Annotation toolbar (using the
tool), this property is set to 'on' if you create a textbox without dragging; however,
if you drag to make the new textbox have a certain size, the property is initially 'off'.
When you create a textbox with the annotation function, for example,
htb = annotation('textbox')
without specifying a position and size, the textbox is created with FitBoxToText set to
'on'. If you specify a position vector in the command, for example,
htb = annotation('textbox', [.1 .8 .4 .1])
the textbox is created with FitBoxToText set to 'off'.
Similarly, if you resize a textbox in plot edit mode or change the width or height of
its position property directly, its FitBoxToText property is set to 'off'. You can
toggle this property with set, with the Property Inspector, or more conveniently, via the
object's context menu, as the illustration below shows.