Graphics    

Adding Arrows and Lines to Graphs

With plot editing mode enabled, you can add arrows and lines anywhere in a figure window.

You can also use arrow characters (TeX characters) to create arrows using the text command. However, arrows created this way can only point to the left or right, horizontally. See Calculating the Position of Text Annotations for an example.

Creating Arrows and Lines in Plot Editing Mode

To add an arrow or line annotation to a graph:

  1. Click on the Insert menu and choose the Arrow or Line option, or click the Arrow or Line buttons in the figure window toolbar.

  1. MATLAB changes the cursor to a cross-hair style.

  1. Position the cursor in the figure where you want to start the line or arrow and press either mouse button. Hold the button down and move the mouse to define the length and direction of the line or arrow.
  2. Release the mouse button.

Editing Arrows and Line Annotations

You can edit the appearance of arrow and line annotations using the Property Editor.

With plot editing mode enabled, double-click on the arrow or line annotation to start the Property Editor, if it is not already started. The Property Editor displays the set of panels specific to arrow or line objects. Use the fields in the panels to change the style, width, color, and many other characteristics of the arrow or line annotation object.


  Drawing Text in a Box Adding Plots of Basic Statistics to Graphs