Graphics Previous page   Next Page

Textbox Annotations

A textbox is a rectangle that can contain multiline text. You can attach the textbox to any point in the figure.

Insert a textbox by clicking the textbox icon in the figure toolbar , then click where you want to place the text string. You can resize the textbox after typing the text or click and drag the box when you create it.

You can also select TextBox from the Insert menu.

Selecting Textbox Objects

The selection behavior of the textbox object differs from other annotation objects.

Pinning the Textbox

You can attach the textbox to a particular point in the figure by pinning it to that point. There are three ways to pin the textbox:

By default, pinning attaches the lower left corner of the textbox to its location in the axes data space. You can move the point of attachment by clicking on the corner and dragging the anchor to another point. The cursor changes to the pin while dragging.

Note that you cannot drag the textbox when it is pinned.

Modifying the Textbox from the Context Menu

Right-clicking in a textbox displays its context menu, which enables you to perform a number of operations on the textbox. In the following picture, the textbox Background Color has been set to yellow using the context menu.

The menu contains the following options:

Setting Textbox Properties

You can use the Property Editor to set textbox properties by selecting Properties from the textbox context menu. It displays the same properties that are described above in the context menu section.

You can click the Inspector button on the Property Editor to display the Property Inspector. The Property Inspector displays all textbox properties. However, you should not change some of these properties because doing so can affect the proper functioning of the textbox.

See Textbox Properties in the reference documentation for a description of the properties you can change.


Previous page  Enclosing Regions of a Graph in a Rectangle or an Ellipse Annotation Lines and Arrows Next page

© 1994-2005 The MathWorks, Inc.