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

legendupdate

Contents

Menu Information

Update Legend

Brief Information

Update or reconstruct legend on the graph page/layer

Command Line Usage

legendupdate dest:=layer update:=reconstruct legend:=combine order:=ascend mode:=lu

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Destination dest

Input

int

0
Specifies where to apply the legend updates.

Option list:

  • page:Whole Page
    Update the legends on the whole active page.
  • layer:Active Layer
    Update the legends on the active layer.
  • spepage:Specific Page
    This is not visible in the dialog box. When this is selected, only the legends on the graph page specified by the page variable will be updated.
  • spelayer:Specific layer
    This is not visible in the dialog box. When this is selected, only the legends on the graph layer specified by the layer variable will be updated.
Update Mode update

Input

int

1
Specifies whether to reconstruct or update the legend.

Option list:

  • reconstruct:Reconstruct
    Reconstruct the legend(s) according to the legend and order variables.
  • update:Update
    Update the existing legend(s).
Legend legend

Input

int

0
This is only available when reconstruct is selected for the update variable. Use this variable to specify the type of legend you want to reconstruct.

Option list:

  • separate:Legend for each Graph
    Construct a separate legend for each layer.
  • combine:One Legend for All
    Construct a legend for all layers in the graph.
Order order

Input

int

1
This is only available when reconstruct is selected for the update variable. When a legend is reconstructed, information must be read from the graph layers. This variable controls the order to read the layers.

Option list:

  • descend:Descending
    Read information from the layers according to their indices in descending order.
  • ascend:Ascending
    Read information from the layers according to their indices in ascending order.
Auto Legend Translation Mode mode

Input

int

0
LabTalk variable notations ("%(1)", "%(2)", etc.) is used to create legends. Origin automatically "translate" the notations into information when constructing a legend. This variable specifies the information that will be used to translate the notations.

Option list:

  • comment:Use Comment (1st line)
    The first line in the Comments row of the source data.
  • dr:Data Range
    The data range of the plot.
  • lu:Long Name & Units
    The long names and units of the source data.
  • udpara:User Parameter 1
    The first User Parameter row of the source data.
  • lname:Long Name
    The Long Name of the source data.
  • sname:Short Name
    The short name of the source data.
  • lpara:Parameter 1
    The first system variable of the source data.
  • custom:Custom
    The information specified by the custom variable.
Legend Custom Format(@D,@LU etc) custom

Input

string

This is available only when custom is selected for the mode variable. Notation entered here will be used to translate the legend notations.
GraphPage page

Input

GraphPage

<optional>
This is only available when dest variable is set to spepage. Use it to specify a graph page. Then the legend(s) on the graph page will be updated.
GraphLayer layer

Input

GraphLayer

<optional>
This is only available when dest variable is set to spelayer. Use it to specify a graph layer. Then the legend on the graph layer will be updated.

Description

This X-function can be used to update or reconstruct legends on graphs or layers.

Examples

For more examples, please refer to XF Script Dialog (press F11).

Related X-Functions