| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
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. For an example of its use, see Positioning Annotations in Data Space in the MATLAB Graphics documentation.
This section lists the properties you can modify on an annotation textarrow object.
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
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.
Character slant. MATLAB uses this property to select a font from those available on your particular system. Generally, setting this property to italic or oblique selects a slanted font.
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.
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).
{points} | normalized | inches | centimeters | pixels
Font size units. MATLAB uses this property to determine the units used by the FontSize property. Normalized units interpret FontSize as a fraction of the height of the parent axes. When you resize the axes, MATLAB modifies the screen FontSize accordingly. pixels, inches, centimeters, and points are absolute units (1 point = 1/72 inch).
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.
scalar value in points
Length of the arrowhead. Specify this property in points (1 point = 1/72 inch). See also HeadWidth.
select string from list
Style of the arrowhead. Specify this property as one of the strings from the following table.
Head Style String | Head | Head Style String | Head |
|---|---|---|---|
none | star4 |
| |
plain |
|
| |
| diamond |
| |
vback1 |
| rose |
|
vback2 (Default) |
| hypocycloid |
|
vback3 |
| astroid |
|
cback1 |
| deltoid |
|
cback2 |
| ||
cback3 |
|
scalar value in points
Width of the arrowhead. Specify this property in points (1 point = 1/72 inch). See also HeadLength.
{left} | center | right
Horizontal alignment of text. This property specifies the horizontal justification of the text string. It determines where MATLAB places the string with regard to the point specified by the Position property. The following picture illustrates the alignment options.

See the text Extent property for related information.
latex | {tex} | 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. The options are:
latex — Supports a basic subset of the LATEX markup language.
tex — Supports a subset of plain TEX markup language. See the String property for a list of supported TEX instructions.
none — Displays literal characters.
{-} | -- | : | -. | none
Line style. This property specifies the line style of the object. Available line styles are shown in the following table.
Specifier String | Line Style |
|---|---|
Solid line (default) | |
Dashed line | |
Dotted line | |
Dash-dot line | |
No line |
scalar
The width of linear objects and edges of filled areas. Specify this value in points (1 point = 1/72 inch). The default LineWidth is 0.5 points.
four-element vector [x, y, width, height]
Size and location of the object. Specify the lower left corner of the object with the first two elements of the vector defining the point x, y in units normalized to the figure (when Units property is normalized). The third and fourth elements specify the object's dx and dy, respectively, in units normalized to the figure.
string
The text string. Specify this property as a quoted string for single-line strings, or as a cell array of strings, or a padded string matrix for multiline strings. MATLAB displays this string at the specified location. Vertical slash characters are not interpreted as line breaks in text strings, and are drawn as part of the text string. See Mathematical Symbols, Greek Letters, and TeX Characters for an example.
When the text Interpreter property is set to Tex (the default), you can use a subset of TeX commands embedded in the string to produce special characters such as Greek letters and mathematical symbols. The following table lists these characters and the character sequences used to define them.
Character Sequence | Symbol | Character Sequence | Symbol | Character Sequence | Symbol |
|---|---|---|---|---|---|
\alpha | α | \upsilon | υ | \sim | ~ |
\beta | β | \phi | Φ | \leq | ≤ |
\gamma | γ | \chi | χ | \infty | ∞ |
\delta | δ | \psi | ψ | \clubsuit | ♣ |
\epsilon | ɛ | \omega | ω | \diamondsuit | ♦ |
\zeta | ζ | \Gamma | Γ | \heartsuit | ♥ |
\eta | η | \Delta | Δ | \spadesuit | ♠ |
\theta | Θ | \Theta | Θ | \leftrightarrow | ↔ |
\vartheta | ϑ | \Lambda | Λ | \leftarrow | ← |
\iota | ι | \Xi | Ξ | \uparrow | ↑ |
\kappa | κ | \Pi | Π | \rightarrow | → |
\lambda | λ | \Sigma | Σ | \downarrow | ↓ |
\mu | µ | \Upsilon | ϒ | \circ | º |
\nu | ν | \Phi | Φ | \pm | ± |
\xi | ξ | \Psi | Ψ | \geq | ≥ |
\pi | π | \Omega | Ω | \propto | ∝ |
\rho | ρ | \forall | ∀ | \partial | ∂ |
\sigma | σ | \exists | ∃ | \bullet | • |
\varsigma | ς | \ni | ∍ | \div | ÷ |
\tau | τ | \cong | ≅ | \neq | ≠ |
\equiv | ≡ | \approx | ≈ | \aleph | ℵ |
\Im | ℑ | \Re | ℜ | \wp | ℘ |
\otimes | ⊗ | \oplus | ⊕ | \oslash | ∅ |
\cap | ∩ | \cup | ∪ | \supseteq | ⊇ |
\supset | ⊃ | \subseteq | ⊆ | \subset | ⊂ |
\int | ∫ | \in | ∈ | \o | ο |
\rfloor | ë | \lceil | é | \nabla | ∇ |
\lfloor | û | \cdot | · | \ldots | ... |
\perp | ⊥ | \neg | ¬ | \prime | ´ |
\wedge | ∧ | \times | x | \0 | ∅ |
\rceil | ù | \surd | √ | \mid | | |
\vee | ∨ | \varpi | ϖ | \copyright | © |
\langle | ∠ | \rangle | ∠ |
|
|
You can also specify stream modifiers that control font type and color. The first four modifiers are mutually exclusive. However, you can use \fontname in combination with one of the other modifiers:
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.
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.
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.
width in points
The width of the text rectangle edge. Specify this value in points (1 point = 1/72 inch). The default TextLineWidth is 0.5 points.
dimension in pixels default: 5
Space around text. Specify a value in pixels that defines the space around the text string, but within the rectangle.
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 are absolute and not relative to previous rotations; a rotation of 0 degrees is always horizontal.
{normalized} | inches | centimeters | characters | points | pixels
position units. MATLAB uses this property to determine the units used by the Position property. All positions are measured from the lower left corner of the figure window. Normalized units interpret Position as a fraction of the width and height of the parent axes. When you resize the axes, MATLAB modifies the size of the object accordingly. pixels, inches, centimeters, and points are absolute units (1 point = 1/72 inch). Units of characters are based on the size of characters in the default system font. The width of one character unit is the width of the letter x, the height of one character unit is the distance between the baselines of two lines of text.
top | cap | {middle} | baseline |
bottom
Vertical alignment of text. This property specifies the vertical justification of the text string. It determines where MATLAB places the string with regard to the value of the Position property. The possible values mean
top — Place the top of the string' s Extent rectangle at the specified y-position.
cap — Place the string so that the top of a capital letter is at the specified y-position.
middle — Place the middle of the string at the specified y-position.
baseline — Place font baseline at the specified y-position.
bottom — Place the bottom of the string's Extent rectangle at the specified y-position.
The following picture illustrates the alignment options.

vector [Xbegin Xend]
X-coordinates of the beginning and ending points for line. Specify this property as a vector of x-axis (horizontal) values that specify the beginning and ending points of the line, units normalized to the figure.
vector [Ybegin Yend]
Y-coordinates of the beginning and ending points for line. Specify this property as a vector of y-axis (vertical) values that specify the beginning and ending points of the line, units normalized to the figure.
![]() | Annotation Rectangle Properties | Annotation Textbox Properties | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |