Documentation Center

  • Trials
  • Product Updates

Add Title to Graph Using Plot Tools

What Is a Title?

In a MATLAB® figure, a title is a text string at the top of an axes. It appears in the figure border, not within the axes it describes. Titles typically define the subject of the graph. The following figure shows a title, centered at its top.

    Note   While you can use text annotations to create a title for your graph, it is not recommended. Titles are anchored to the top of the axes they describe; text annotations are not. If you move or resize your axes, the title remains at the top. Additionally, if you cut a title and then paste it back into a figure, the title is no longer anchored to the axes.

You can add a title to a graph interactively in several ways, described in the following sections.

Using the Title Option on the Insert Menu

To add a title to a graph using the Insert menu,

  1. Click the Insert menu in the figure menu bar and choose Title. A text entry box opens at the top of the axes.

      Note   Selecting the Title option enables plot editing mode automatically.

  2. Enter the text of the label.

  3. When you are finished entering text, click anywhere in the figure background to close the text entry box around the title. If you click on another object in the figure, such as an axes or line, you close the title text entry box and also automatically select the object you clicked.

To change the font used in the title to bold, you must edit the title. You can edit the title as you would any other text object in a graph.

Using the Property Editor to Add a Title

To add a title to a graph using the Property Editor,

  1. Start plot editing mode by selecting Edit Plot from the figure Tools menu.

  2. Double-click an empty region of the axes in the graph. This starts the Property Editor. You can also start the Property Editor by right-clicking on the axes and selecting Show Property Editor from the context menu or by selecting Property Editor from the View menu.

    The Property Editor displays a property panel specific to axes objects. Titles are a property of axes objects.

  3. Type the text of your title in the Title text entry box.

You can change the font, font style, position, and many other aspects of the title format.

  • To move the title, select the text and drag it to the desired position.

  • To edit the text, double-click the title and type new characters.

  • To change the font and other text properties, select the title and right-click to display the context menu.

See Also

Related Examples

Was this topic helpful?