Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Annotation Textarrow Properties

Define annotation textarrow properties

Modifying Properties

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 Annotation Objects in the MATLAB® Graphics documentation.

Annotation Textarrow Property Descriptions

This section provides a description of properties. Curly braces { } enclose default values.

Color

ColorSpec

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). The default value is [0 0 0] (black).

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:

  1. Set the Color property to red — set(h,'Color','r')

  2. Set the TextColor to black — set(h,'TextColor','k')

  3. Set the 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.

FontAngle

{normal} | italic | oblique

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.

FontName

string

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. Specify in points. 1 point = 1/72 inch. The default size is 10.

FontUnits

{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.

FontWeight

{normal} | bold | light | demi

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

size in points

Length of the arrowhead. Specify this property in points. 1 point = 1/72 inch. The default value is 10. See also HeadWidth.

HeadStyle

string

Style of arrowhead. Specify this property as one of the strings from the following table.

 Arrow Head Style Table

HeadWidth

size in points

Width of arrowhead. Specify in points. 1 point = 1/72 inch. The default value is 10. See also HeadLength.

HorizontalAlignment

left | center | {right}

Horizontal alignment of text. Specifies the horizontal justification of the text string. This property determines where MATLAB places the string horizontally with regard to the points specified by the Position property.

Interpreter

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.

LineStyle

{-} | -- | : | -. | none

Line style of arrow stem.

 Line Style Specifiers Table

LineWidth

size in points

Width of arrow stem. Specify in points 1 point = 1/72 inch. The default is 0.5 points.

Position

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). width and height specify the object's dx and dy, respectively, in units normalized to the figure. The default value is [0.3 0.3 0.1 0.1].

String

string

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.

    Note:   The words default, factory, and remove are reserved words that will not appear in a figure when quoted as a normal string. In order to display any of these words individually, type '\reserved_word' instead of 'reserved_word'.

When the text Interpreter property is 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. This table lists these characters and the character sequences used to define them.

Character Sequence

Symbol

Character Sequence

Symbol

Character Sequence

Symbol

\alpha

α

\upsilon

υ

\sim

~

\angle

\phi

Φ

\leq

\ast

*

\chi

χ

\infty

\beta

β

\psi

ψ

\clubsuit

\gamma

γ

\omega

ω

\diamondsuit

\delta

δ

\Gamma

Γ

\heartsuit

\epsilon

ɛ

\Delta

Δ

\spadesuit

\zeta

ζ

\Theta

Θ

\leftrightarrow

\eta

η

\Lambda

Λ

\leftarrow

\theta

Θ

\Xi

Ξ

\Leftarrow

\vartheta

ϑ

\Pi

Π

\uparrow

\iota

ι

\Sigma

Σ

\rightarrow

\kappa

κ

\Upsilon

ϒ

\Rightarrow

\lambda

λ

\Phi

Φ

\downarrow

\mu

µ

\Psi

Ψ

\circ

º

\nu

ν

\Omega

Ω

\pm

±

\xi

ξ

\forall

\geq

\pi

π

\exists

\propto

\rho

ρ

\ni

\partial

\sigma

σ

\cong

\bullet

\varsigma

ς

\approx

\div

÷

\tau

τ

\Re

\neq

\equiv

\oplus

\aleph

\Im

\cup

\wp

\otimes

\subseteq

\oslash

\cap

\in

\supseteq

\supset

\lceil

\subset

\int

\cdot

·

\o

ο

\rfloor

\neg

¬

\nabla

\lfloor

\times

x

\ldots

...

\perp

\surd

\prime

´

\wedge

\varpi

ϖ

\0

\rceil

\rangle

\mid

|

\vee

  

\copyright

©

\langle

  

      
      
      

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.

TextBackgroundColor

ColorSpec | {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

Color of text. A three-element RGB vector or one of the MATLAB predefined names, specifying the arrow color. The default value is [0 0 0] (black).

See the ColorSpec reference page for more information on specifying color. Setting the Color property also sets this property.

TextEdgeColor

ColorSpec | {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

Width of text rectangle edge. Specify in points. 1 point = 1/72 inch. The default value is 0.5.

TextMargin

size in pixels

Space around text. A value in pixels that defines the space around the text string, but within the rectangle. Default value is 5 pixels.

TextRotation

rotation angle in degrees

Text orientation. 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. Default is 0.

Units

{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 — 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 — Absolute units. 1 point = 1/72 inch.

  • characters — Based on the size of characters in the default system font. The width of one characters unit is the width of the letter x, and the height of one characters unit is the distance between the baselines of two lines of text.

VerticalAlignment

top | cap | {middle} | baseline |
bottom

Vertical alignment of text. Specifies the vertical justification of the text string. It determines where MATLAB places the string vertically with regard to the points specified by the Position property.

Note that top and cap both place the text at the top, while baseline and bottom both align the text on the bottom.

X

vector [Xbegin Xend]

x-coordinates of beginning and ending points for line. A vector of x-axis (horizontal) values specifying the beginning and ending points of the line, units normalized to the figure. The default value is [0.3 0.4].

Y

vector [Ybegin Yend]

y-coordinates of beginning and ending points for line. A vector of y-axis (vertical) values specifying the beginning and ending points of the line, units normalized to the figure. The default value is [0.3 0.4].

See Also

Was this topic helpful?