| MATLAB Function Reference | ![]() |
You can set and query annotation object properties using the set and get functions and the Property Editor (displayed with the propertyeditor command).
Use the annotation function to create annotation objects and obtain their handles.
Annotation Textarrow Property Descriptions
Properties You Can Modify
This section lists the properties you can modify on an annotation ellipse object.
Color ColorSpec Default: [0 0 0]
Color of the arrow, text and text border. A three-element RGB vector or one of the MATLAB predefined names, specifying the color of the arrow, the color of the text (TextColor property), and the rectangle enclosing the text (TextEdgeColor property).
Setting the Color property also sets the TextColor and TextEdgeColor properties to the same color. However, if the value of the TextEdgeColor is none, it remains none and the text box is not displayed. You can set TextColor or TextEdgeColor independently without affecting other properties.
For example, if you want to create a textarrow with a red arrow and black text in a black box, you must:
Color property to red -- set(h,'Color','r')
TextColor to black -- set(h,'TextColor','k')
TextEdgeColor to black.-- set(h,'TextEdgeColor','k')
If you do not want display the text box, set the TextEdgeColor to none.
See the ColorSpec reference page for more information on specifying color.
FontName A name, such as Helvetica
Font family. A string specifying the name of the font to use for the text. To display and print properly, this font must be supported on your system. The default font is Helvetica.
FontSize size in points
Approximate size of text characters. A value specifying the font size to use in points. The default size is 10 (1 point = 1/72 inch).
FontWeight light | {normal} | demi | bold
Weight of text characters. MATLAB uses this property to select a font from those available on your system. Generally, setting this property to bold or demi causes MATLAB to use a bold font.
HeadLength scalar value in points
Length of the arrow head. Specify this property in points (1 point = 1/72 inch). See also HeadWidth.
HeadStyle select string from list
Style of the arrow head. Specify this property as one of the strings from the following table.
| Head Style String |
Head |
Head Style String |
Head |
none |
star4 |
![]() |
|
plain |
![]() |
rectangle |
![]() |
ellipse |
![]() |
diamond |
![]() |
vback1 |
![]() |
rose |
![]() |
vback2 (Default) |
![]() |
hypocycloid |
![]() |
vback3 |
![]() |
astroid |
![]() |
cback1 |
![]() |
deltoid |
![]() |
cback2 |
![]() |
||
cback3 |
![]() |
HeadWidth scalar value in points
Width of the arrow head. Specify this property in points (1 point = 1/72 inch). See also HeadLength.
HorizontalAlignment {left} | center | right
Horizontal alignment of text. This property specifies the horizontal alignment of the text with respect to the arrow.
Interpreter {tex} | latex | none
Interpret TEX instructions. This property controls whether MATLAB interprets certain characters in the String property as TEX instructions (default) or displays all characters literally. See the text object String property for a list of supported TEX instructions.
To enable a complete TEX interpreter for text objects, set the Interpreter property to latex.
LineStyle {-} | -- | : | -. | none
Line style. This property specifies the line style of the arrow stem. Available line styles are shown in the following table.
| Specifier String |
Line Style |
- |
Solid line (default) |
-- |
Dashed line |
: |
Dotted line |
-. |
Dash-dot line |
none |
No line |
LineWidth scalar
The width of the arrow stem. Specify this value in points (1 point = 1/72 inch). The default LineWidth is 0.5 points.
String string
The text string. Specify this property as a quoted string for single-line strings, or as a cell array of strings for multiline strings. MATLAB displays this string in the text box with the specified HorizontalAlignment and VerticalAlignment. See the Interpreter property for information on using TEX characters.
TextBackgroundColor ColorSpec Default: none
Color of text background rectangle. A three-element RGB vector or one of the MATLAB predefined names, specifying the arrow color.
See the ColorSpec reference page for more information on specifying color.
TextColor ColorSpec Default: [0 0 0]
Color of text. A three-element RGB vector or one of the MATLAB predefined names, specifying the arrow color.
See the ColorSpec reference page for more information on specifying color. Setting the Color property also sets this property.
TextEdgeColor ColorSpec or none Default: none
Color of edge of text rectangle. A three-element RGB vector or one of the MATLAB predefined names, specifying the color of the rectangle that encloses the text.
See the ColorSpec reference page for more information on specifying color. Setting the Color property also sets this property.
TextLineWidth width in points
The width of the text rectangle edge. Specify this value in points (1 point = 1/72 inch). The default LineWidth is 0.5 points.
TextMargin dimension in pixels default: 5
Space around text. Specify a value in pixels that defines the space around the text string, but within the TextEgdeColor rectangle.
TextRotation rotation angle in degrees (default = 0)
Text orientation. This property determines the orientation of the text string. Specify values of rotation in degrees (positive angles cause counterclockwise rotation). Angles do not acculate; a rotation of 0 degrees is alway horizontal.
VerticalAlignment top | cap | {middle} | baseline |
bottom
Vertical alignment of text. This property specifies the vertical alignment of the text with respect to the arrow. The possible values mean
top -- Place the top of the string at the specified y-position.
cap -- Place the string so that the top of a capital letter is at the y-position.
middle -- Place the middle of the string at the y-position.
baseline -- Place font baseline at the y-position.
bottom -- Place the bottom of the string at the y-position.
X vector [Xbegin Xend]
Beginning and ending points for arrow. Specify this property as a vector of x-axis (horizontal) values that specify the beginning and ending points of the arrow, units normalized to the figure.
Y vector [Ybegin Yend]
Beginning and ending points for arrow. Specify this property as a vector of y-axis (vertical) values that specify the beginning and ending points of the arrow, units normalized to the figure.
| Annotation Rectangle Properties | Annotation Textbox Properties | ![]() |
© 1994-2005 The MathWorks, Inc.