Skip to content

annotation

plot · scripts/plot/appearance/annotation.m

: h = annotation (type, x, y)
: h = annotation (type, pos)
: h = annotation (fig, …)
: h = annotation (…, prop, val, …)

Create an annotation object on a figure.

type (case is ignored) is "line", "arrow", "doublearrow" or "textarrow", which take two-element vectors x and y (start and end point), or "textbox", "rectangle" or "ellipse", which take a position [x y w h]. All coordinates are normalized figure units. Trailing property/value pairs are applied to the new object.

The object lives in a hidden overlay axes of the figure (tag "scribeOverlay"), not among the children of the user’s axes. Its properties ("X", "Y", "Position", "Color", "LineStyle", "LineWidth", "HeadStyle", "String", "FaceColor", …) are available through get and set; the handle is a group object.