Graphics Previous page   Next Page

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 Positions 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 the Insert menu and choose the Arrow or Line option, or click the Arrow or Line button in the Plot Edit toolbar.

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

  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 context menu.

With plot editing mode enabled, right-click on the arrow or line annotation to display its context menu.

For more options, select Properties to display the Property Editor.


Previous page  Drawing Text in a Box Basic Plotting Commands Next page

© 1994-2005 The MathWorks, Inc.