Back to Top
OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis
 
Skip Navigation Links
All BooksExpand All Books
LabTalk ProgrammingExpand LabTalk Programming
Language ReferenceExpand Language Reference
Reference TablesExpand Reference Tables

3.9.12 Text Label Options

Every text label on a graph or worksheet has a text object name. To get that name, select the text label by clicking on it with your mouse, right click, and select Programming Control .... The Object Name field contains the name, whose text$ attribute can be changed either arbitrarily or with some text label options to substitute worksheet information.

LabTalk supports applying existing page and dataset information to your text labels, using syntax such as:

objectName.text$ = %([workbookName]worksheetName!columnName,@option, variableName)

to refer a worksheet information variable, and in which variable options are listed in Substitution Notation

or using

objectName.text$ = %([workbookName]worksheetName, @option, columnNumber)

to refer other worksheet information by specifying a column in worksheet.

or using

objectName.text$ = %(PlotIndex[PlotDesignChar], @option)

to specify a data plot by PlotIndex and a column from this plot by PlotDesignChar such as X, Y or Z. This is only used for text labels on graphs.

For example in a graph legend, you may use:

legend.text$ = %(2Y, @LC);

to specify that for the 2nd dataplot in the current layer, use the comment field (of the Y column plotted) as the legend entry.

Besides legend other text object names on a graph include yl (left-side y-axis), xb (bottom x-axis), so that

yl.text$ = %(?Y,@WL);   // Make the workbook long name = Y-label text  
xb.text$ = %(1X,@LU);   // Make the units of the X dataset the X-label

The %(?Y) is a special syntax that allows the text label to default to a pre-specified data plot index (which can be set in Plot Details: Legends/Titles: Data Plot Index for Auto Axis Titles), instead of an index (1, 2, ... n) that you supply.

In addition, in an X-Function, it is also possible to use an option such as:

legendupdate mode:=custom custom:=@option

this tells Origin: for all legend entries, report the location (in Origin Range Notation) of the data being plotted.


Most @ text-label options can be applied to any text label on both a graph or a worksheet, but some options are specially designed for certain syntax only.

For example, refer to this table for available @options for the syntax below:

%([workbookName]worksheetName, @option, columnNumber)

And this table for available @options for a different syntax:

%(PlotIndex[PlotDesignChar], @option)

In addition, the table below presents the available @options can be used for both the above syntax:

@option Substitute Text From...
@C Column Short Name. Equivalent to @LS.
@D Dataset name
@L Column Long Name, will return to missing value if long name does not exist. Equivalent to @LL.
@LA Long Name, if available, else Short Name.
@LC Comments, if available, else Long Name, otherwise Short Name
@LCn The nth line of the Comments field.
@LD First user-defined parameter.
@LDn The nth user-defined parameter. @LD1 is equivalent as @LD.
@LD"name" The user-defined parameter with the specified name.
@LG Long Name (if not available then Short Name) and Units (if present). Equivalent to @U.
@LH The name of the first User-Defined Parameter.
@LHn The name of the nth User-Defined Parameter.@LH1 is equivalent to @LH.
@LL Equivalent to @L.
@LM 1st line of Comment, if available, else Long Name, otherwise Short Name.
@LN 1st line of Comments (if not available then Long Name, otherwise Short Name) and Units. Equivalent to @(@LM(@LU)).
@LP The first System Parameter.
@LPn The nth System Parameter. @LP is the same as @LP1.
@LQ The first User-Defined Parameter and Units (if available).
@LQn The nth User-Defined Parameter and Units (if available).
@LQ"name" The User-Defined Parameter (specified by name) and Units (if available).
@LS Column Short Name, equivalent to @C
@LU Units
@U Long Name (if not available then Short Name) and Units (if present). Equivalent to @LG

Note: When units are displayed in the substituted texts, the English and Japanese versions of Origin enclose the units in parentheses (), while the German version uses square-brackets [].

 

© OriginLab Corporation. All rights reserved.