Main Content

Labels and Annotations

Add titles, axis labels, informative text, and other graph annotations

Add a title, label the axes, or add annotations to a graph to help convey important information. You can create a legend to label plotted data series or add descriptive text next to data points. Also, you can create annotations such as rectangles, ellipses, arrows, vertical lines, or horizontal lines that highlight specific areas of data.

Functions

expand all

titleAdd title
subtitleAdd subtitle to plot (Since R2020b)
sgtitleAdd title to grid of plots
xlabelLabel x-axis
ylabelLabel y-axis
zlabelLabel z-axis
fontnameChange font name for objects in a figure (Since R2022a)
fontsizeChange font size for objects in a figure (Since R2022a)
legendAdd legend to axes
bubblelegendCreate legend for bubble chart (Since R2020b)
textAdd text descriptions to data points
gtextAdd text to figure using mouse
xlineVertical line with constant x-value
ylineHorizontal line with constant y-value
xregion1-D filled region between x-coordinates (Since R2023a)
yregion1-D filled region between y-coordinates (Since R2023a)
constantplaneInfinite plane in 3-D coordinates (Since R2024b)
annotationCreate annotations
datatipCreate data tip
lineCreate primitive line
rectangleCreate rectangle with sharp or curved corners
texlabelFormat text with TeX characters
ginputIdentify axes coordinates

Properties

expand all

Text PropertiesAxes text appearance and behavior
Text PropertiesText appearance and behavior for grid of plots
Text PropertiesTiled chart layout text appearance and behavior
Legend PropertiesLegend appearance and behavior
BubbleLegend PropertiesBubble legend appearance and behavior (Since R2020b)
ConstantLine PropertiesConstant line appearance and behavior
ConstantRegion PropertiesConstant region appearance and behavior (Since R2023a)
ConstantPlane PropertiesConstant plane appearance and behavior (Since R2024b)
Arrow PropertiesArrow appearance and behavior
DoubleEndArrow PropertiesDouble end arrow appearance and behavior
Ellipse PropertiesEllipse appearance and behavior
Line PropertiesAnnotation line appearance and behavior
Rectangle PropertiesAnnotation rectangle appearance and behavior
TextArrow PropertiesText arrow appearance and behavior
TextBox PropertiesText box appearance and behavior
Line PropertiesPrimitive line appearance and behavior
Rectangle PropertiesRectangle appearance and behavior

Topics