Using the Plot Editor (Plot Editor)

Plot Editor Search Help Desk

Using the Plot Editor

The Plot Editor is an easy-to-use tool for plots that allows you to add and modify:

  • Text, arrow, and line annotations
  • Axes title, legend, grid, tick steps, and labels
  • Plot line properties such as line style, thickness, color, and marker


Process for Using the Plot Editor (Plot Editor)

Process for Using the Plot Editor

This is a suggested process for using the Plot Editor. You can link to more specific instructions for each step.

1.
Create a plot in MATLAB®.
2.
Start plot edit mode. See Starting Plot Edit Mode.
3.
Modify the axes.
Important:
Modify the axes before adding annotations and legends because annotations and legends are not anchored to the axes. If you add annotations and legends first and then later modify the axes, the annotations and legends do not move with the axes, and you probably will need to reposition them.

  1. Create any subplots, and change the axes size, position, magnification, and orientation. See Creating Subplots and Positioning Axes.
  2. Set axes properties. This includes specifying the title, axes labels, tick step, limits, scale, and grid. See Setting Axes Properties.
4.
Modify properties of the plots. This includes specifying the line width, style, marker, and color. See Changing Line Properties.
5.
Add the axes legend. See Adding a Legend.
6.
Add text, arrow, and line annotations. See Adding Annotations.
7.
Save and/or print the figure. See Saving and Opening Figures in the Plot Editor and Printing Figures from the Plot Editor.


Relationship to MATLAB Commands (Plot Editor)

Relationship to MATLAB Commands

Any function you perform with the Plot Editor can be performed using MATLAB commands. For example, you can specify the plot line color in the Plot Editor (see Editing Object Properties) or by using the plot command with the LineSpec Color argument.

Constraints

Some features that are available using MATLAB commands, such as specifying your own tick mark labels, are not available through the Plot Editor. If there is something you cannot do using the Plot Editor, look for a MATLAB command to do it.

The Plot Editor features cannot be used to change the properties for images, surfaces, and patch objects such as bar graphs. Instead, use graphics commands.

Differences Between Plot Editor and MATLAB Command-Generated Annotations

There are some differences between the annotations you add using the Plot Editor and the annotations you add using MATLAB commands. See MATLAB Handle Graphics and the Plot Editor for more information.

Special Notes for Use with Other Tools and Applications

  • If you are creating a plot in an M-file and do not want the toolbar menu to appear in the figure window, use this command
      set(fig,'ToolBar','none')
  • If you build graphic user interfaces (GUIs) and do not want the Tools menu to appear in the figure menu bar for GUIs you build, use the command
      plotedit(fig,'hidetoolsmenu')

    To include the Tools menu in the menu bar, use the command

      plotedit(fig,'showtoolsmenu')


The Plot Editor Interface (Plot Editor)

The Plot Editor Interface

The Plot Editor has a very intuitive user interface. You can access most Plot Editor functions from the Tools menu, or you can use alternative methods, such as right-clicking on objects. The main ways to use the interface are covered here. For more detailed information about how to perform a specific task, see the help topic for the specific task:

  • Starting Plot Edit Mode
  • Tools Menu to Add Objects and Modify Selected Objects
  • Toolbar Buttons to Add Annotations
  • Editing Text Strings
  • Context-Sensitive Pop-Up Menus to Modify Objects
  • Editing Text Strings
  • Editing Object Properties
  • Moving and Resizing Objects
  • Selecting and Deselecting Objects
  • File, Edit, Window, and Help Menus


Starting Plot Edit Mode (Plot Editor)

Starting Plot Edit Mode

Click the selection button in the toolbar to start plot edit mode. The button becomes highlighted, indicating plot edit mode is on. Plot edit mode allows you to access the Plot Editor functions. To end plot edit mode, click the selection button; the button is no longer highlighted.

You can also start plot edit mode by selecting Enable Plot Editing from the Tools menu.

Adding text, arrow, and line annotations by using the toolbar buttons or adding annotations or axes using the Tools menu automatically starts plot edit mode.

You can also start and end plot edit mode using the plotedit command.


Tools Menu to Add Objects and Modify Selected Objects (Plot Editor)

Tools Menu to Add Objects and Modify Selected Objects

After starting plot edit mode, use the Tools menu to add objects, modify selected objects, and to hide or show the toolbar. Note that there are alternative ways to perform most of these functions; for example, to add a line annotation, either select Add Line from the Tools menu, or click the line annotation toolbar button. Selecting a Plot Editor item from the Tools menu automatically starts plot edit mode, if it is not already on.


Toolbar Buttons to Add Annotations (Plot Editor)

Toolbar Buttons to Add Annotations

Use toolbar buttons to add annotations.

1.
Click a toolbar button. This starts plot edit mode if it is not already on, allowing you to create an annotation.
2.
Move the cursor to the area where you want to locate the annotation.
  • For text, click and then type the annotation text.
  • For an arrow or line, drag the cursor to draw the annotation.


Context-Sensitive Pop-Up Menus to Modify Objects (Plot Editor)

Context-Sensitive Pop-Up Menus to Modify Objects

1.
Start plot edit mode.
2.
Right-click on an object in the figure window.
A pop-up menu relevant to that object appears.
3.
Select an item from the pop-up menu to perform that action.


Editing Text Strings (Plot Editor)

Editing Text Strings

You can edit any of the text strings in the figure window.

1.
Start plot edit mode.
2.
Double-click on the string. Or right-click on the string and select String from the pop-up menu.
An editing box appears around the text.
3.
Make any changes to the text.
4.
Click anywhere outside of the text edit box to end text editing.


Editing Object Properties (Plot Editor)

Editing Object Properties

You can edit properties of the axes, plot lines, and annotations.

1.
Start plot edit mode.
2.
Select the object.
3.
From the Tools menu, select Axes Properties, Line Properties, or Text Properties.
The properties dialog box for that object appears.
4.
Make any changes in the dialog box and click OK or Apply.

Right-Clicking on an Object

1.
Start plot edit mode.
2.
Edit a single property or multiple properties:
  • For text, lines, and arrows, right-click on the object. Then edit a single property directly from the resulting pop-up menu, for example, line width.
  • For any object, right-click on the object. Then select Properties from the pop-up menu to access the properties dialog box for that object.

Double-Clicking on an Object

1.
Start plot edit mode.
2.
For axes, lines, and arrows, double-click on the object to access the properties dialog box for that object.
Note that double-clicking on text lets you edit the text string; use another method to edit text properties.


Moving and Resizing Objects (Plot Editor)

Moving and Resizing Objects

You can move and resize annotations, labels, titles, and axes. You can move, but cannot resize legends and text objects.

Important:
Move and resize the axes before adding annotations and legends because annotations and legends are not anchored to the axes. If you add annotations and legends first and then later move or resize the axes, the annotations and legends do not move with the axes and you probably will need to reposition them.

1.
Start plot edit mode.
2.
Select the object.
Selection handles appear on the object.
3.
Perform this step only for axes; for other objects, skip to the next step. From the Tools menu, select Unlock Axes Position, which allows the axes to be modified.
Alternatively, right-click in an empty area of the axes and select Unlock Axes Position from the pop-up menu.
4.
To move the object, drag it to the new location.
5.
To resize the object, drag a selection handle.


Copying and Deleting Objects (Plot Editor)

Copying and Deleting Objects

1.
Start plot edit mode.
2.
Select the object.
3.
Select the appropriate editing command from the Edit menu or use standard shortcut keys for your platform.
Alternatively, right-click on the object and then select the appropriate editing command from the pop-up menu.


Selecting and Deselecting Objects (Plot Editor)

Selecting and Deselecting Objects

Selecting the Axes

1.
Start plot edit mode.
2.
Select the axes by clicking anywhere within the axes, but not on an object. Selection handles appear on the sides of the axes.

Selecting Multiple Objects

1.
Start plot edit mode.
2.
Shift-click to select multiple objects and then perform an action on all of the selected objects. For example, select a text and arrow annotation, and then select Cut from the Edit menu; the text and arrow annotations are cut.

Deselecting Objects

Shift-click on a selected object to deselect it.


File, Edit, Window, and Help Menus (Plot Editor)

File, Edit, Window, and Help Menus

Use the menu items as described here:

  • File menu - to open, save, print, and export figure files.
  • Edit menu - to access editing items such as Cut. Another way to access the editing functions is through pop-up menus and standard shortcuts for your platform.
  • Window menu - make another window become the current window.
  • Help menu - for viewing Plot Editor help and additional graphics documentation, and for accessing other information.


Getting Help (Plot Editor)

Getting Help

To access help for the Plot Editor:

  • Select Editing Plots from the Help menu.
  • Click the Help button in a dialog box to go directly to a help topic for that dialog box.
  • At the command line, use help plotedit and doc plotedit.
For information about other graphics features, select Using MATLAB Graphics from the Help menu in the figure window.


Axes Functions (Plot Editor)

Axes Functions

Use the Plot Editor's axes functions for:

  • Creating Subplots
  • Copying and Deleting Axes
  • Positioning Axes
  • Setting Axes Properties (such as title, tick step, scale, grid, labels, and limits)


Creating Subplots (Plot Editor)

Creating Subplots

Use the Plot Editor to create multiple plots (subplots) within a figure.

Important:
Create subplots before adding annotations and legends because annotations and legends are not anchored to the axes. If you add annotations and legends first and then later modify the axes, the annotations and legends do not move with the axes and you probably will need to reposition them.

To create subplots in a figure window:

1.
Select Add Axes from the Tools menu.
A crosshair cursor appears in the figure window.
2.
Draw the outline for the axes.
The new axes are added to the figure window.
3.
Reposition the subplots. See Positioning Axes.
All Plot Editor axes tools as well as any plot functions you perform from the command line apply to the current subplot. Click on a subplot to make it the current subplot.


Copying and Deleting Axes (Plot Editor)

Copying and Deleting Axes

You can cut, copy, paste, and clear axes in figure windows.

1.
Start plot edit mode.
2.
Select the axes you want to copy or delete, and then select the appropriate editing item from the Edit menu, for example, Cut, or use the standard shortcut for your platform such as Ctrl+X for Cut on Windows.
Alternatively, you can right-click on the axes and select an editing item from the pop-up menu.

  • Cut removes the axes from the figure window but allows you to paste it later.
  • Copy keeps the axes in the figure window and allows you to paste it later.
  • Clear removes the axes from the figure window.
Note that if you want to copy axes to another figure window and want the axes to appear in the same position in the other figure window, lock the position for the axes you are copying before you select Copy.
3.
If you selected Cut or Copy, you can now Paste the axes in a figure window.
  1. Click at the location in the figure window where you want the axes to appear. This can be in the same figure window or a different figure window. If in a different figure window, plot edit mode must be on in that window.
  2. Select Paste from the Edit menu, or use the standard shortcut for your platform, for example, Ctrl-V on Microsoft Windows. If you are pasting into a figure window that already contains axes, you can right-click in any axes and select Paste from the pop-up menu.

    The axes is pasted in the figure window.


Positioning Axes (Plot Editor)

Positioning Axes

Use the Plot Editor to move and resize axes. You can also zoom and rotate axes from the toolbar, but these functions end plot edit mode.

Important:
Position axes before adding annotations and legends because annotations and legends are not anchored to the axes. If you add annotations and legends first and then later position the axes, the annotations and legends do not move with the axes and you probably will need to reposition them.

Moving and Resizing Axes

1.
Start plot edit mode.
2.
Select the axes by clicking in an empty area of the axes.
Selection handles appear on the axes.
3.
Drag the selected axes to the new position, or drag a handle to resize the axes.

Zooming and Rotating Axes

Use the zoom or rotate 3-D features for the current axes. Note that using zoom or rotate automatically ends plot edit mode. Also note that properties, such as the title, automatically adjust to the new magnification or orientation, but annotations do not.

Zooming. Click the zoom in button on the toolbar. Then click on an area of the axes where you want to zoom in, or drag the cursor to draw a box around the area where you want to zoom in. The axes redraws, zooming in on the area you specified. You can repeatedly click in the axes or draw additional boxes in the axes to further magnify the area. To end zoom in mode, click the zoom in button.

Click the zoom out button on the toolbar and then click on an area of the axes where you want to zoom out. To end zoom out mode, click the zoom out button.

The zoom buttons use the camzoom command.

Rotating. Click the rotate 3-D button on the toolbar. An outline of the figure appears in the axes to help you visualize the rotation. Drag the cursor in the direction you want to rotate. Click the rotate button again to end rotate mode. The rotate button uses the rotate3d command.


Setting Axes Properties (Plot Editor)

Setting Axes Properties

To set axes properties, such as the title:

1.
Start plot edit mode.
2.
Click in an empty area of the axes to select the axes and then select Axes Properties from the Tools menu. Or in an empty area of the axes, right-click and select Properties from the pop-up menu, or double-click in an empty area of the axes.
The Edit Axes Properties dialog box opens.

Note:
If you have a two-dimensional graph, the fields for the Z axis will not appear in the dialog box.

3.
Complete the fields in the dialog box and click Apply or OK to make the changes.
See these topics for more information:
  • Axes Title and X, Y, and Z Labels
  • Axes Limits
  • Axes Tick Step
  • Axes Scale
  • Axes Grid
  • Example - Setting Axes Properties
  • MATLAB Commands for Axes Properties

Axes Title and X, Y, and Z Labels

In the Edit Axes Properties dialog box, type the text for the axes Title and for the X, Y, and Z labels. For the Title, press the Return or Enter key to advance text to the next line. The title text is added in the center at the top of the plot and the axes labels are centered along their respective axes.

Changing Titles and Labels. You can change the text in the title and labels. See Changing Text, Arrows, and Lines for instructions. The changes you can make include:

  • Changing font properties and including special characters such as mathematical symbols, Greek characters, and subscripts.
  • Editing and moving text.
  • Making a multiline axis label.
If you do not want the y-axis label to appear vertically, or you do not want a multiline title to be center-justified, create the label or title as a text annotation.

Axes Limits

In the Edit Axes Properties dialog box, set axes Limits.

If the Limits Manual box is not checked, MATLAB automatically sets axes limits based on the range of specified data. The limit values MATLAB selects appear in the Limits edit boxes.

If you want MATLAB to set axes limits automatically but the Manual box is checked, uncheck the Manual box. The values MATLAB selects appear in the Limits edit boxes when you click Apply.

Set Minimum and Maximum. If you want to specify limits for any of the axes, check the Manual checkbox. Then enter the minimum value in the left Limits edit box and the maximum value in the right Limits edit box for that axis.

Axes Tick Step

In the Edit Axes Properties dialog box, set the Tick Step for the axes.

If the Tick Step Manual box is not checked, MATLAB automatically sets tick mark spacing based on the data range. The tick step values that MATLAB selects appear in the Tick Step edit boxes.

If you want MATLAB to set tick mark spacing automatically but the Manual box is checked, uncheck the Manual box. The values MATLAB selects appear in the Tick Step edit boxes when you click Apply.

Specify Spacing. If you want to specify tick mark spacing for any of the axes, check the Manual checkbox. Then enter the tick step value in the Tick Step edit box for that axis. For example, 10, sets a tick mark every 10 units. Set the value to 0 if you do not want tick marks displayed for that axis. You cannot manually set the tick step if the axes scale is set to Log.

Axes Scale

In the Edit Axes Properties dialog box, set the Scale properties for each axis.

Linear or Log. Select a linear or logarithmic scale.

Normal or Reverse. Select the direction for increasing values. This figure illustrates the directions.

See the axes property XDir for more information.

Axes Grid

In the Edit Axes Properties dialog box, check the Grid On box to add gridlines perpendicular to that axis, one line for each tick mark. Uncheck the box to remove the gridlines.

Example - Setting Axes Properties

This example sets axes properties for the plot of the Lotka-Volterra model of predator/prey populations. The figure below shows how the plot looks after setting axes properties.

1.
Create the Lotka-Volterra plot using 0 to 15 years as the time frame and an initial population size of 20 for both predators and prey.
    [t,y]=ode23('lotka',[0 15],[20;20])
plot(t,y)
2.
Click the selection arrow button in the toolbar to start plot edit mode.
3.
Double-click in an empty area of the axes.
The Edit Axes Properties dialog box appears.
4.
Make changes to the Title, X and Y Label, X Tick Step, and X Grid fields as shown below, then click OK.

The dialog box closes and the figure window reflects the changes.

MATLAB Commands for Axes Properties

If you need to change the axes properties in a way that the Plot Editor does not support, you might be able to make the change using the axes command. The tooltips for the fields in the Edit Axes Properties dialog box provide the name of the corresponding axes property.


Adding a Legend (Plot Editor)

Adding a Legend

Important: The legend is not anchored to the axes. If you resize or move the axes, or create new subplots, you probably will need to move the legend afterwards. For this reason, resize or move the axes before adding legend.

To add a legend for the axes:

1.
Start plot edit mode.
2.
From the Tools menu, select Show Legend. Or right-click in an empty area of the axes, and from the pop-up menu, select Show Legend.
The legend appears in the figure. Below is an example of a legend.

3.
To edit the text in the legend, double-click directly on the text. An edit box appears around the text. Make changes to the text and then click outside of the text edit box to see the changes.
4.
Move the legend by dragging it to the new location.
To hide the legend, select Show Legend from the Tools menu, or right-click in the axes and select Show Legend from the pop-up menu. The menu item becomes unchecked and the legend does not appear in the axes.

When you make changes to the plot lines, for example, change the color, the legend automatically updates to reflect the changes.


Adding Annotations (Plot Editor)

Adding Annotations

Add text, arrow, and line annotations using the annotation toolbar buttons.

Important: Annotations are not anchored to the axes. If you resize or move the axes, or create new subplots, you probably will need to move or resize the annotations afterwards. For this reason, resize or move the axes before adding annotations. For the same reason, add titles and axes labels using the Edit Axes Properties dialog box, as described in Setting Axes Properties, rather than creating them as annotations.

1.
Click a toolbar annotation button, either text, arrow, or line.

This automatically starts plot edit mode if it is not already on. The cursor shape changes to an I-beam for text and to a crosshair for arrows and lines.
Alternatively, you can select Add from the Tools menu to add an annotation.
2.
Move the cursor to the area where you want to locate the annotation and then create the annotation.
  • For text, click and then type the text in the edit box that appears. Press the Return or Enter key to advance to a new line. When you are finished typing, click somewhere outside of the edit box.
  • For an arrow or line, drag the cursor to draw the annotation from end to tip.

Changing Annotations

You can change annotations. Specifically, you can:

  • Change font properties for text annotations.
  • Include special characters in the text annotations, such as mathematical symbols.
  • Edit and move annotations.
See Changing Text, Arrows, and Lines for instructions.


Example - Adding Annotations (Plot Editor)

Example - Adding Annotations

This example adds arrow and text annotations to the plot of the Lotka-Volterra model of predator/prey populations. The figure below shows how the plot looks after adding the annotations.

1.
Create the Lotka-Volterra plot using 0 to 15 years as the time frame and an initial population size of 20 for both predators and prey.
    [t,y]=ode23('lotka',[0 15],[20;20])
plot(t,y)
2.
Add a text annotation.
  1. Click the text annotation button in the Plot Editor toolbar.
  2. Move the cursor to the location where you want the text to appear and click.
  3. Type the following, pressing the Enter or Return key to advance to new lines.

    Many Predators;
    Prey Population
    Will Decline

  4. Click outside of the text annotation area to see the text you just added.
3.
Add an arrow annotation.
  1. Click the arrow annotation button in the Plot Editor toolbar.
  2. Move the cursor to the location where you want the end of the arrow to appear.
  3. Draw the arrow by dragging the cursor from the end of the arrow to the tip of the arrow.
To move or change the annotations you just added, see instructions in Example - Changing Text, Arrows, and Lines.


Changing Text, Arrows, and Lines (Plot Editor)

Changing Text, Arrows, and Lines

You can make these changes to line and arrow annotations, or any text you added to the figure. For plot lines, you can cut, copy, or delete them, or change line properties, but you cannot move or resize them:

  • Copying and Deleting Text, Arrows, and Lines
  • Moving Text, Arrows, and Lines
  • Resizing Arrows and Lines
  • Changing Line Properties
  • Changing Text


Copying and Deleting Text, Arrows, and Lines (Plot Editor)

Copying and Deleting Text, Arrows, and Lines

You can cut, copy, paste, and clear objects you added to the figure window. The object can be a text, arrow, or line annotation, plot line, the axes title, or an axis label.

1.
Start plot edit mode.
2.
Select the object you want to copy or delete, and then select the appropriate editing item from the Edit menu, for example, Cut, or use the standard shortcut for your platform such as Ctrl+X for Cut on Windows.
Alternatively, you can right-click on the object and select an editing item from the pop-up menu.

  • Cut removes an object from the figure window, but allows you to paste it later.
  • Copy keeps the object in the figure window, and allows you to paste it later.
  • Clear removes an object from the figure window.
3.
If you selected Cut or Copy, you can now Paste the object in a figure window. Click at the location in the figure window where you want the object to appear and select Paste from the Edit menu, or use the standard shortcut for your platform, for example, Ctrl-V on Windows. Alternatively, right-click at the location in an axes and select Paste from the pop-up menu.
You can paste in the same figure window or a different figure window. If in a different figure window, plot edit mode must be on in that window.

Moving Text, Arrows, and Lines

You can move arrow and line annotations, or any text you added to the figure.

Start plot edit mode. Drag the object to the new position.

Resizing Arrows and Lines

You can resize arrow and line annotations.

Start plot edit mode. Select the object and then drag a handle.


Changing Line Properties (Plot Editor)

Changing Line Properties

To change the line properties for plot lines and for arrow and line annotations:

1.
Start plot edit mode.
2.
Select the line or arrow whose properties you want to change and then select Line Properties from the Tools menu. Alternatively, you can right-click on the line or arrow and select Properties from the pop-up menu, or just double-click on the line or arrow.
The Edit Line Properties dialog box appears.

3.
Make changes in the dialog box and click OK.

Line Width

In the Line Properties dialog box, type a new value for Line Width, in points (1 point = 1/72 inch). The default line width is .5 points.

Alternatively, you can right-click on an object, select Line Width from the pop-up menu, and select a value from a list of pre-defined line widths.

Line Style

In the Line Properties dialog box, select a new style from the Line Style list. The default line style is solid.

Alternatively, you can right-click on an object, select Line Style from the pop-up menu, and select a style from the list.

Marker Size

In the Line Properties dialog box, type a new value for the Marker Size, in points (1 point = 1/72 inch). The marker is the symbol included in the plot line to distinguish it from other plots. See the line command marker properties for more information.

Marker Symbol

In the Line Properties dialog box, select a new symbol from the Marker list. The marker is the symbol included in the plot line to distinguish it from other plots.

If you want to change the marker edge color or face color, use the line command marker properties.

Line Color

In the Line Properties dialog box, click the Select button to change the line color. The Color dialog box opens. Select one of the pre-defined colors or define a custom color. The default line color for the first plot is blue and for all annotations is black.

Alternatively, you can right-click on an object and select Color from the pop-up menu to access the Color dialog box.


Changing Text (Plot Editor)

Changing Text

To change text:

1.
Start plot edit mode.
2.
Right-click on the text you want to change. The text pop-up menu appears.

3.
Select the appropriate item from the pop-up menu and make changes as described below.
  • String
  • Font Size
  • Font Style, for example, bold
  • Font Color
  • Font Properties, for example, to use Times

String

After selecting String from the pop-up menu, an edit box appears around the text. Make changes to the text and then click outside of the text edit box to see the changes. Another way to edit a text string is by double-clicking on the text.

Making a Multiline Axis Label. First add an axis label using the Axes Properties dialog box. Then edit the label as a text string to create a multiline label.

Subsequently, when you are in the Axes Property dialog box, you will only see the first line in the Label field. To see additional lines in the label field, click in the field and press the down arrow key.

Special Characters. To create special characters in a text string, such as Greek letters, mathematical symbols, superscripts and subscripts, use embedded TeX sequences. For example, \pi creates [image]. See the String property of the text command for a list of supported TeX sequences, and see Example - Including Text with Special Characters.

Font Size

After selecting Font Size from the pop-up menu, select a font size from the list, or select More..., which displays the Font Properties dialog box where you can specify a different size. The default font size is 10 points.

Font Style

After selecting Font Style from the pop-up menu, select normal, bold, or italic. You can also specify these styles, as well as bold italic, from the Font Properties dialog box.

Font Color

After selecting Color from the pop-up menu, the Color dialog box opens. Select one of the predefined colors or define a custom color. The default color for text is black.

Font Properties

After selecting Properties from the pop-up menu, the Edit Font Properties dialog box appears. In the dialog box, change the font family (the default family is Helvetica), the font style, or the size. Then click OK.


Example - Changing Text, Arrows, and Lines (Plot Editor)

Example - Changing Text, Arrows, and Lines

Add another text annotation and make changes to the annotations for the Lotka-Volterra model you created and annotated in Example - Adding Annotations.

After making these changes, the annotations will look like those in the figure below.

1.
Start plot edit mode.
2.
Add another text annotation by copying and editing the annotation you already made in Example - Adding Annotations.
  1. Right-click on the text annotation you already made.
  2. Select Copy from the pop-up menu.
  3. Move the cursor to the approximate location where you want the second text annotation to appear.
  4. Right-click and select Paste.
  5. Change the text: double-click the annotation you just pasted, select the word Many, and over it, type Few. Then select the word Decline, and over it, type Increase.
  6. Click outside of the annotation area to see the changes.
3.
Make the text annotations appear in bold.
  1. Shift-click on the two text annotations so that both are selected.
  2. Right-click on any selected annotation text, select Font Style from the pop-up menu, and select bold.
The text appears in bold.
4.
Change the color of the arrow annotation to red.
  1. Right-click on the arrow annotation.
  2. Select Color from the pop-up menu.
  3. In the Color dialog box, select a red color and click OK.
The arrow is red.
5.
Copy the red arrow to point to the second annotation.
  1. Right-click on the arrow annotation.
  2. Select Copy from the pop-up menu.
  3. Move the cursor to the approximate location where you want the second arrow annotation to appear.
  4. Right-click and select Paste.
6.
If you need to, drag the annotations to adjust their positions, or drag the arrow's handle to change the annotation's size.


Example - Including Text with Special Characters (Plot Editor)

Example - Including Text with Special Characters

In this example you add a legend to the plot of the Lotka-Volterra model of predator/prey populations and modify the legend to include text with special characters. After completing this example, the result will look like the figure below.

1.
Create the Lotka-Volterra plot using 0 to 15 years as the time frame and an initial population size of 20 for both predators and prey.
    [t,y]=ode23('lotka',[0 15],[20;20])
plot(t,y)
2.
Add a legend for the plot.
  1. Click the arrow selection button in the toolbar to start plot edit mode.
  2. Right-click in an empty area of the axes.

    The axes pop-up menu appears.

  3. Select Show Legend from the pop-up menu.

    The legend shown here appears in the upper-right corner of the figure.

3.
Drag the legend to move it to the top center of the figure.
4.
Change the legend text.
  1. Double-click on the data1 string in the legend.

    An edit box appears around data1.

  2. Select all the text in the edit box and over it, type the replacement text

    Y_1 Prey

    The _ (underscore) is the TeX sequence that makes the characters following it appear as subscripts. See Special Characters for more information.

  3. Click outside of the edit box.

    The text changes appear in the legend.

  4. Change the data2 text string to Y2 Predator, using steps a through c to guide you.


Saving and Opening Figures in the Plot Editor (Plot Editor)

Saving and Opening Figures in the Plot Editor

Saving a Figure as a Figure File

Save a figure that was annotated or labeled with the Plot Editor so that you can open the figure during another session and continue editing it.

1.
Select Save from the File menu or click the save button on the toolbar.
2.
If this is the first time you are saving the file, the Save As dialog box appears. Type the File name of the figure, be sure that the Save as type is Figure file, and click OK.
The figure is saved as a figure file (.fig), which is a binary file used for figures created with the Plot Editor.
You can also use the saveas command.

If you want to use the figure in another application, see Exporting and Copying Figures from the Plot Editor.

Opening a Figure

To open a figure file to use with the Plot Editor:

1.
Select Open from the File menu or click the open button on the toolbar.
2.
Select the File name of the figure file you want to open and click OK.
The figure file appears in a new figure window.
You can also use the open command.


Exporting and Copying Figures from the Plot Editor (Plot Editor)

Exporting and Copying Figures from the Plot Editor

When you save a figure in the Plot Editor, the result is a figure file (.fig), which can then be opened and edited in the Plot Editor. If you want to use a figure with an application other than the Plot Editor, you can:

  • Export the figure, which saves it using a standard graphics file format, such as TIFF or EPS.
  • Copy the figure to the Windows clipboard and then paste it using another application (Windows platforms only).

Exporting a Figure (Saving to a Different Format)

1.
Select Export from the File menu.
The Export dialog box appears.
2.
Complete the fields and click Save.
Note that in the Plot Editor you can open only a figure file (.fig), so in addition to exporting a figure, save it as a figure file (.fig) - see Saving a Figure as a Figure File.

Copying a Figure to the Windows Clipboard

This feature is for Windows platforms only.

1.
Select Copy Options from the Edit menu.
The Copying Options page of the Preferences dialog box appears.
2.
Complete the fields on the Copying Options page and click OK.
3.
Select Copy Figure from the Edit menu.
The figure is copied to the Windows clipboard. You can then paste the figure from the Windows clipboard into a file in another application.


Printing Figures from the Plot Editor (Plot Editor)

Printing Figures from the Plot Editor

Before printing a figure:

1.
Select Page Setup from the File menu to set printing options.
The Page Setup dialog box opens.
2.
Make changes in the dialog box. If you want the printed output to exactly match the annotated plot you see on the screen:
  1. For Limits, check the box to Match Axes Limits and Ticks.
  2. For Size and Position, select Match Figure Screen Size.
For more information about other options for page setup, click the Help button in the dialog box.
To print a figure, select Print from the File menu and complete the Print dialog box that appears. You can also use the print command.


MATLAB Handle Graphics and the Plot Editor (Plot Editor)

MATLAB Handle Graphics and the Plot Editor

The Plot Editor provides a graphical user interface for performing many of MATLAB's graphics commands and Handle Graphics® functions. You can use both MATLAB graphics commands and the Plot Editor to modify the properties of a figure, but if you do so, note these differences.

Annotation Differences

Annotations you create using the text and line commands are anchored to the axes, meaning they move with the axes. Annotations you create using the Plot Editor are independent of the axes. Plot Editor annotations are part of a transparent axes that overlays the axes containing the plots. If you move the axes, annotations created with the Plot Editor do not move with the axes and you will probably have to reposition them.

If you create an annotation in the Plot Editor, you can use gco to get the handle for that annotation and then perform other MATLAB commands on that object.

To make annotations that move with the axes, create the annotations using the text and line commands. Then you can edit the annotations in the Plot Editor. Changes you make to the annotations in the Plot Editor are reflected in the axes properties, which you can see by using the get command.

Font Differences

To create special characters in text, such as Greek letters or mathematical symbols, be sure to use TeX sequences - see the text command string property. If instead you create the special characters by using the Edit Font Properties dialog box and selecting the Symbol font family, you will not be able to edit that text object using MATLAB commands.