title
ADD title to axes or legend collapse All in page Syntax title (TXT) example title (Txt,name,value) example title (O bj,___) Example T = title (___) Example Description
Example
Title (TXT) adds the specified title at the top and in the center of the current axes. reissuing the title command causes the new title to replace the old title.
Example
Title (txt,name,value) additionally specifies title properties using one or more name,value pair arguments.
Example
Title (obj,___) adds a title to the object specified by obj, instead of the current axes. Specify obj as either an axes object or a Legend object. Obj can precede any of the input argument combinations in the previous syntaxes.
Example
t = title (___) Returns the object used as the title text. Use T-make future modifications to the title. Examples
Collapse All Add Title to current figure Open this Example
Create a figure and display a title in the current axes.
Figure
Plot ((1:10). ^2)
title (' My title ')
You also can call the title with a function, that returns a string. For example, the DATE function returns a string containing today's date.
Title (date)
Matlab®sets the output of date as the axes title. Include Variable ' s Value in Title Open this Example
Include the value of variable C in a title.
Figure
Plot ((1:10). ^2)
f =;
c = (f-32)/1.8;
Title ([' Temperature is ', Num2str (c), ' C '])
Create multicolored Title Using TeX Markup Open this Example
In a TeX string, with the color modifier \color to change the color of characters following it from the previous color.
Figure
Plot ((1:10). ^2)
title ([' \fontsize{16}black {\color{magenta}magenta ' ... ')
\color[rgb]{0.5.5}teal \color{red}red} Black again '])
Create colored Title Using name,value Pair Argument Open this Example
Use the name,value pair ' color ', ' m ' to set the Color of the title to magenta.
Figure
Plot ((1:10). ^2)
title (' Case number # 3 ', ' Color ', ' m ')
Include Greek Symbols in Title Open this Example
Use a TeX string to include Greek symbols in a title.
t = (0:0.01:0.2);
y = exp ( -25*t);
Figure
Plot (t,y)
title (' Y = \ite^{\lambda t} ', ' Color ', ' B ')
The ' interpreter ' property must is ' Tex ' (the default).