MATLAB Function Reference Previous page   Next Page
title

Add title to current axes

Syntax

Description

Each axes graphics object can have one title. The title is located at the top and in the center of the axes.

title('string') outputs the string at the top and in the center of the current axes.

title(fname) evaluates the function that returns a string and displays the string at the top and in the center of the current axes.

title(...,'PropertyName',PropertyValue,...) specifies property name and property value pairs for the text graphics object that title creates.

title(axes_handle,...) adds the title to the specified axes.

h = title(...) returns the handle to the text object used as the title.

Examples

Display today's date in the current axes:

Include a variable's value in a title:

Include a variable's value in a title and set the color of the title to yellow:

Include Greek symbols in a title:

Include a superscript character in a title:

Include a subscript character in a title:

The text object String property lists the available symbols.

Create a multiline title using a multiline cell array.

Remarks

title sets the Title property of the current axes graphics object to a new text graphics object. See the text String property for more information.

See Also

gtext, int2str, num2str, text, xlabel, ylabel, zlabel

Annotating Plots for related functions

Adding Titles to Graphs for more information on ways to add titles


Previous page  timerfindall todatenum Next page

© 1994-2005 The MathWorks, Inc.