Graph: Update Legend
Update or reconstruct graph legend
1. legendupdate dest:=layer update:=reconstruct legend:=combine order:=ascend mode:=lu;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Update Scope | dest |
Input int |
|
Specifies where to apply the legend updates.
Option list:
|
Update Mode | update |
Input int |
|
Specifies whether to reconstruct or update the legend.
Option list:
|
Legend | legend |
Input int |
|
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:
|
Order | order |
Input int |
|
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:
|
Plot Order within Layer | porder |
Input int |
|
This is only available when reconstruct is selected for the update and combine is selected for the legend variable. This variable controls the plot order to read within a layer.
Option list:
|
Auto Legend Translation Mode | mode |
Input int |
|
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:
|
Legend Custom Format(@D,@LU etc) | custom |
Input string |
|
This is available only when custom is selected for the mode variable. You can add any literal before, after and in between the legend notations. Notations entered here will be used to translate. |
Additional Format (for @L, @V etc.) | addon |
Input string |
|
This is available only when custom is selected for mode and @L, @V or @WT is selected for custom variable. Specify nth row and/or mth column to complete notation of worksheet cell access. Refer to Notations for details. |
GraphPage | page |
Input GraphPage |
|
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 |
|
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. |
Show Legend for Visible Plots Only | hide |
Input int |
Specify whether to show the hidden plot in legend | |
Hide Legend for Fitted Curves | fit |
Input int |
Specify whether to hide the fitted curve(s) in legend or not | |
Indicate Active Dataset | indicate |
Input int |
Specify whether to indicate the active dataset in the legend. |
This X-function can be used to update or reconstruct legends on graphs or layers. It is accessible from menu with a graphical dialog. You can refer to this online help for the controls in graphical dialog.
This example shows how to update graph legends. The sample data can be imported from <exe_path>\Samples\Signal Processing\Signal with Shot Noise.dat.
// Get sample data fn$ = system.path.program$ + "Samples\Signal Processing\Signal with Shot Noise.dat"; newbook; impASC fn$; // Plot a line graph, //the default legend uses both worksheet long name and unit as legend. plotxy col(2) plot:=0; // Update legend; legendupdate mode:=lu;