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.

Title, Titles

Object title

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

Title, TitlesOptionalText string

Graphics Primitives

ObjectsDefault Values
plot::Piechart2d, plot::Piechart3d

Titles: [" "]


Title sets the title of an object to be displayed in the graphics.

Titles is a list of titles for parts of an object, e.g., the pieces of a pie chart.

Using Title, any graphical object can be given a title that will be displayed at the position given by the TitlePosition attribute.

The Title can additionally be horizontically aligned at the TitlePosition via TitleAlignment.

The object attribute Visible also affects the object's title: Invisible objects do not show their titles.

Titles is used to set a number of titles for sub-objects, such as the bars of a bar plot or the segments of a pie chart. These do not react to TitlePosition.

Title and Titles cannot be animated. But note that TitlePosition can.


Example 1

The default positioning of a title relative to TitlePosition is to have the lower left corner of the title at this place:

plot(plot::Point2d(1, 1, Title = "Test",
                   TitlePosition = [1, 1]))

This position depends on the title alignment:

plot(plot::Point2d(1, 1, Title = "Test",
                   TitlePosition = [1, 1],
                   TitleAlignment = Left))

Example 2

In 3D, titles have so-called “bill-boarding”: Instead of having a fixed orientation, they are always drawn in a readable orientation and their sizes are not affected by zooming and perspective scaling:

plot(plot::Point3d(1, 1, 1,
                   Title = "Nr. 1",
                   TitlePosition = [1, 1, 1]),
     plot::Point3d(2, 20, 2,
                   Title = "Nr. 2",
                   TitlePosition = [2, 20, 2]),
     plot::Point3d(10, 10, 10,
                   Title = "Nr. 3",
                   TitlePosition = [10, 10, 10]),
     TitleFont = [30])

Example 3

Titles of invisible objects are invisible themselves. This also applies to objects that are temporarily invisible:

plot(plot::Point2d(i, i, 
          Title = expr2text(i), TitlePosition = [i+1/10, i],
          VisibleAfter = i) $ i = 1..5,
     TimeRange = 0..5,
     ViewingBox = [0..5, 0..5])

Example 4

Use Titles to label individual parts of statistical plots such as pie charts:

plot(plot::Piechart2d([3267, 2629, 4970, 18094,
                       4189, 1236, 4003, 297],
                      Titles = ["<= 1900", "1901-1918",
                              "1919-1948", "1949-1978",
                              "1979-1986", "1987-1990",
                              "1991-2000", ">= 2001"]))

Note that pie charts with many pies are in general tricky to label nicely:

p := plot::Piechart3d([10601, 12330, 3388, 2593, 660, 1726,
                       6078, 1760, 7956, 18052, 4049, 1066,
                       4384, 2581, 2804, 2411],
             Titles = ["Baden-Württemberg", "Bayern", "Berlin",
                       "Brandenburg", "Bremen",
                       "Hamburg", "Hessen",
                       "Niedersachsen", "Nordrhein-Westfalen",
                       "Rheinland-Pfalz", "Saarland", "Sachsen",
                       "Sachsen-Anhalt", "Schleswig-Holstein",
plot(p, Header = "Einwohner 2001")

p::Moves := [0.3]:
plot(p, Header = "Einwohner 2001")

See Also

MuPAD Functions

Was this topic helpful?