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.
Create a simple line plot.
x = linspace(1,10); plot(x,sin(x))
To modify the title and axis labels, first enable plot edit mode by clicking the Edit Plot button on the figure toolbar.
To change the text, double-click it and type new text.
To move the text, drag it to a new position.
To set text properties, such as the color and font style, right-click the text and use the context menu.
To set additional properties, use the Property Editor. Select Show Property Editor from the context menu.
Add a legend to the graph. In the figure, select Insert > Legend.
By default, the legend labels each plotted object with
data2, and so on. Change the legend label by double-clicking the label and
retyping a new label. Display special characters and symbols using TeX markup. For example, use
_ character to display a subscript. For a list of supported TeX markup,
see the text
To display a legend with more than 50 items, use the
To change the legend location, right-click the legend and set the Location option from the context menu. For additional location options, or to modify other legend properties, use the Property Editor. Select View > Property Editor to open the Property Editor. Then, click the legend to access its properties.
Add a text box and a text arrow to the graph using the TextBox and Text Arrow options from the Insert menu. To add a text box, draw a rectangle and then type the text at the text cursor. To add a text arrow, draw an arrow from tail to head and type the text at the text cursor next to the tail.