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 Textbox Property Descriptions
Properties You Can Modify
This section lists the properties you can modify on an annotation ellipse object.
BackgroundColor
ColorSpec Default: none
Color of textbox background. A three-element RGB vector or one of the MATLAB predefined names, specifying the background color of the textbox. A value of none
makes the textbox transparent, enabling objects behind the textbox to be visible.
Color
ColorSpec Default: [0 0 0]
Color of the 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.
EdgeColor
ColorSpec Default: [0 0 0]
Color of the textbox edge. A three-element RGB vector or one of the MATLAB predefined names, specifying the edge color.
See the ColorSpec
reference page for more information on specifying color.
FaceAlpha
Scalar alpha value in range [0 1]
Transparency of textbox background. This property defines the degree to which the textbox background color is transparent. A value of 1
(the default) makes to color opaque, a value of 0
makes the background completely transparent (i.e., invisible). The default FaceAlpha is 1
.
FitHeightToText
on | {off}
Automatically adjust textbox height to fit text. MATLAB automatically wraps text strings to fit the width of the textbox. However, if the text string is long enough, it extends beyond the bottom of the textbox.
When you set this mode to on
, MATLAB automatically adjusts the height of the textbox to accommodate the string.
The fit-height-to-text behavior continues to apply if you resize the textbox from the two side handles.
However, if you resize the textbox from any other handles, the position you set is honored without regard to how the text fits the box.
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
A name, such as Helvetica
Font family. A string specifying the name of the font to use for the textbox object. 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.
HorizontalAlignment
{left} | center | right
Horizontal alignment of text. This property specifies the horizontal justification of the textbox string. It determines where MATLAB places the string with respect to the value of the Position
property's x value (the first element in the position vector).
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 of edge. This property specifies the line style of the textbox edge. 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 textbox edge. Specify this value in points (1 point = 1/72 inch). The default LineWidth
is 0.5 points.
Margin
scalar pixel value
Space around text. Specify a value in pixels that defines the space around the text string, but within the textbox.
Position
four-element vector [x, y, width, height]
Size and location of textbox. Specify the lower-left corner of the textbox with the first two elements of the vector defining the point x, y. The third and fourth elements specify the width and height respectively.
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 at the specified Position
. See the Interpreter
property for more information on using TEX characters.
VerticalAlignment
top | cap | {middle} | baseline |
bottom
Vertical alignment of text within textbox. This property specifies the vertical alignment of the text in the textbox. It determines where MATLAB places the string with respect to the value of the Position
property's y value (the second element in the position vector). 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.
Annotation Textarrow Properties | ans |
© 1994-2005 The MathWorks, Inc.