OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

Creating and Updating the Default Legend


A legend is automatically created any time that you plot data. When plotting workbook/worksheet data in 2D and applicable 3D graph templates, Origin creates a default legend that combines data plot style information with dataset information and places the resulting label object in the upper-right corner of the graph page.

Contents

How Origin creates the default legend

The default legend object is created using LabTalk variable notation. The advantage is twofold:

Image:Creating and Updating the Default Legend 01.png.

How the default legend is displayed is controlled by the Translation mode of %(1), %(2) list on the Legends tab of the Plot Details dialog box (Format: Page).

Note that any of these legend display options can be saved with the graph template, making this the new default display option.

Manually adding a new legend object

If you delete the legend object from the graph, you can add a new legend object by doing one of the following:

Note that above actions will also refresh the legend object if that is needed.

Automatically updating the default legend

To configure the legend object so that it updates automatically when data are added to or removed from the graph layer:

  1. From the menu, choose Format: Page. This opens the Plot Details dialog box at the graph page level.
  2. Click on the Legends/Titles tab.
  3. Enable Auto reconstruct legends upon add or remove plot.

Including data plots from all graph layers in the legend

When you create a legend, by default, it is created in -- and only displays the data plots contained in -- the active layer. If a legend already exists in the layer, the menu command updates the existing legend so that it lists all data plotted in the layer.

To display data plots from all layers in the legend, do the following:

  1. From the menu, choose Format: Page.
  2. Click on the Legends/Titles tab.
  3. Enable Include data plots from all layers when constructing legend.

Including a single customized data point in the legend

One of the more common legend customizations involves adding a single, customized data point to the legend. Origin allows you to customize a single data point in a scatter, line & symbol or bar/column chart -- as you might do for emphasis. When you do this, you can add the data plot symbol to the graph legend by simply refreshing the legend object.

  1. To customize a single data point, point to the data point in the graph window, hold the CTRL key and double-click on it. After using the Plot Details dialog box controls to customize the data point, click OK to close the dialog box.
  2. If the legend needs to be refreshed, click the New Legend button on the Graph toolbar. The text that displays next to the customized will simply be the row index number of the chosen data point.
  3. To edit the legend text of the data point, please see Changing the legend text in the Origin Help file.

Controlling the width of the data plot symbol in the legend

To control the width of the data plot type icons in the legend:

  1. Select Format: Page to open the Plot Details dialog box.
  2. Select the Legends/Titles tab, and then type the desired value in the Legend Symbol Width text box. Units are % of font point size.

Controlling the proportions of the legend background

To resize the background (the box around the legend):

  1. Click on the edge of the legend background. Sizing handles (the " = " marks) will appear.
    Image:Creating and Updating the Default Legend 03.png
  2. Drag a handle to resize the background.

Setting the active data plot using the legend

To enable the selection of the active data plot by clicking on the respective data plot symbol in the legend, or to have the legend's data plot symbol indicate the layer's active data plot (dataset):

Image:Creating and Updating the Default Legend04.png.
  1. Select Format: Page to open the Plot Details dialog box.
  2. Select the Legends/Titles tab and enable Indicate Active Dataset.

The active data plot (dataset) is now indicated by a red (or green) rectangle surrounding the data plot symbol. This active layer indicator is not printed or exported.