This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Titles and Labels

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


title Add title
xlabel Label x-axis
ylabel Label y-axis
zlabel Label z-axis
clabel Label contour plot elevation
legend Add legend to axes
colorbar Colorbar showing color scale
text Add text descriptions to data points
texlabel Format text with TeX characters
gtext Add text to figure using mouse
line Create primitive line
rectangle Create rectangle with sharp or curved corners
annotation Create annotations


Colorbar Properties Control colorbar appearance and behavior
Legend Properties Control legend appearance and behavior
Primitive Line Properties Control primitive line appearance and behavior
Rectangle Properties Control rectangle appearance and behavior
Text Properties Control text appearance and behavior
Arrow Properties Control arrow appearance and behavior
DoubleEndArrow Properties Control double end arrow appearance and behavior
Ellipse Properties Control ellipse appearance and behavior
Annotation Line Properties Control annotation line appearance and behavior
Annotation Rectangle Properties Control annotation rectangle appearance and behavior
TextArrow Properties Control text arrow appearance and behavior
TextBox Properties Control text box appearance and behavior


Programmatic Workflow

Add Title, Axis Labels, and Legend to Graph

This example shows how to add a title, axis labels and a legend to a graph using the title, xlabel, ylabel and legend functions.

Add Text to Specific Points on Graph

This example shows how to add text descriptions with arrows that point to three data points on a graph.

Greek Letters and Special Characters in Graph Text

You can add text to a graph that includes Greek letters and special characters using TeX markup.

Text with Mathematical Expression Using LaTeX

These examples show how add text to a graph that includes mathematical expressions using LaTeX.

Include Variable Values in Graph Text

These examples show how to include variable values in text on a graph.

Display Text Outside Axes

This example shows how to display text outside an axes by creating a second axes for the text.

Exclude Objects from Graph Legend

This example shows how to plot several lines and create a legend that includes descriptions for a subset of the lines.

Specify Legend Descriptions During Line Creation

This example shows how to plot multiple lines and specify the associated legend labels during the plotting command.

Create Interactive Legends Using Callbacks

You can create interactive legends so that when you click an item in the legend, the associated chart updates in some way.

Tools Workflow

Add Text to Graph Interactively

This example shows how to interactively add a title, legend, axis labels, and other text to a graph using the figure menus and plot tools.

Add Annotations to Graph Interactively

These examples show how to interactively add annotations to a graph and pin them to the axes.

Align Objects in Graph Using Alignment Tools

This example shows how to align text boxes in a graph using alignment tools.

Was this topic helpful?