3.9.14 Text Label OptionsText-Label-Options
Label Option
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.
Syntax
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, such as legend and axis title.
Notes:
To combine multiple @options interspersed with arbitrary text, use the following syntax:
%(PlotIndex,@(@option1+@option2+...))
For example,
%(1,@(@LL(@LU)))// shown as '''Long Name(Units)'''
|
Examples
LegendLegend Substitution
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.
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.
Axis TitleAxis Title Substitution
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); // Left Y axis title = the workbook long name of plotted Y
xb.text$ = %(1X,@LU); // Bottom X axis title = the units of the 1st plot's X dataset
yl.text$ = %(?Y,@(@LL<@LU>)); //Left Y axis title = plotted Y's column long name followed with units in < >.
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.
Complete List of @Options
Below is a table of available @ text-label options for customizing the text labels, including legend text and axis title. See the screenshots for the worksheet properties which will be referenced by the sample expressions:
Note: While many of these "@" label options can only apply to workbook data, some of them are applicable to matrix data. For instance, the expression ...
%(1,@W)
... will return the matrix book short name.
|
@option
|
Substitute Text From...
|
Example
|
@C
|
Column Short Name. Equivalent to @LS.
|
%(1,@C) --> B
|
@D
|
Dataset name
|
%(?Y,@D) --> Book1_B
|
@L
|
Column Long Name, will return to missing value if long name does not exist. Equivalent to @LL.
|
%(1Y,@L) --> Delta Temperature
|
@L,n
|
The nth X value
|
%(1,@L,2) --> 0.02
|
@LA
|
Long Name, if available, else Short Name.
|
%(1,@LA) --> Delta Temperature
|
@LC
|
Comments, if available, else Long Name, otherwise Short Name
|
%(1,@LC) --> YBCO milled
|
@LCn
|
The nth line of the Comments field.
|
%(1,@LC2) -->milled
|
@LD
|
First user-defined parameter.
|
%(1,@LD) -->S21
|
@LDn
|
The nth user-defined parameter. @LD1 is equivalent as @LD.
|
%(1,@LD2) -->235
|
@LD"name"
|
The user-defined parameter with the specified name.
|
%(1,@LD"RunNo")-->07
|
@LG
|
Long Name (if not available then Short Name) and Units (if present). Equivalent to @U.
|
%(1,@LG) -->Delta Temperature (K)
|
@LH
|
The name of the first User-Defined Parameter.
|
%(1,@LH) -->UserDefined
|
@LHn
|
The name of the nth User-Defined Parameter.@LH1 is equivalent to @LH.
|
%(1,@LH3) -->RunNo
|
@LL
|
Equivalent to @L.
|
%(1,@LL) --> Delta Temperature
|
@LM
|
1st line of Comment, if available, else Long Name, otherwise Short Name.
|
%(1,@LM) --> YBCO
|
@LN
|
1st line of Comments (if not available then Long Name, otherwise Short Name) and Units. Equivalent to @(@LM(@LU)).
|
%(1,@LN) --> YBCO(K)
|
@LP
|
The first System Parameter.
|
%(1,@LP) --> Version 2.1
|
@LPn
|
The nth System Parameter. @LP is the same as @LP1.
|
%(1,@LP2) --> 12/15/2004
|
@LQ
|
The first User-Defined Parameter and Units (if available).
|
%(1,@LQ) --> S21(K)
|
@LQn
|
The nth User-Defined Parameter and Units (if available).
|
%(1,@LQ2) --> 235(K)
|
@LQ"name"
|
The User-Defined Parameter (specified by name) and Units (if available).
|
%(1,@LQ"RunNo") --> 07(K)
|
@LS
|
Column Short Name, equivalent to @C
|
%(1,@LS) --> B
|
@LU
|
Units
|
%(1,@LU) --> K
|
@R
|
Dataset range
|
%(1,@R) -->
[Book1]"Trial Run 2"!Col("Delta Temperature")[1:32]
|
@R1
|
Dataset range without row index
|
%(1,@R1) -->
[Book1]"Trial Run 2"!Col("Delta Temperature")
|
@RB
|
Starting row index of the plotted data
|
%(1,@RB) -->
1
|
@RE
|
Ending row index of the plotted data, same as @RN if @RB is 1
|
%(1,@RE) -->
32
|
@RN
|
Total number of rows in the plotted data (will not exclude missing values or masked data points)
|
%(1,@RN) -->
32
|
@U
|
Long Name (if not available then Short Name) and Units (if present). Equivalent to @LG
|
%(1,@U) -->Delta Temperature (K)
|
@V, n
|
The value of the nth point in the data plot.
|
%(1Y, @V, 2) -->0.02863
|
@V"above"/@V"below"
|
Use in Fill Area Under Curve graph only. When Fill to next data plot - Above Below Color is selected, this notation is used for labels to indicate the filled-color above / below base curve.
|
%(1, @V"above")
%(1, @V"below")
--> Above B Below B
|
@W
|
Short Name of book (workbook, matrix)
|
%(1,@W) -->Book1
|
@WCn
|
The nth line of the WorkBook Comment. If n is not specified, only the first line will be shown.
|
%(1,@WC2) -->
<Origin EXE Folder>\Samples\Curve Fitting
|
@WL
|
Long Name of book (workbook, matrix)
|
%(1,@WL) -->S21-235-07
|
@WMn
|
The nth line of the WorkSheet Comment. If n is not specified, only the first line will be shown.
|
%(1,@WM) -->Data imported from
|
@WP
|
Project Explorer (PE) path of the book (workbook, matrix)
|
%(1,@WP) -->/Folder1/
|
@WS
|
Name of the sheet (workbook, matrix)
|
%(1,@WS) -->Trial Run 2
|
@WT, ColIndex/ColName, RowIndex
|
The sheet cell value specified by the column index (or short name) and row index.
|
- %(1, @WT, 2, 3)
- the cell value at column 2, row 3 in the source sheet (worksheet, matrix) of the 1st data plot. Because it's numeric, you can use $($(%(1, @WT, 2, 3), .2)*100) to get string of the number with two decimal place times 100.
- %(1, @WT, B, 3)
- the cell value at column B, row 3 in the source worksheet of the 1st data plot.
|
@WT, ColIndex/ColName, ColLabelRowCharacter
|
The worksheet cell value specified by the column index (or short name) and column label row character.
|
- %(1, @WT, B, C)
- Similar to B[C]$, this will get the Comment from column B, in the source worksheet of the 1st data plot.
|
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 [].
|