2.3.2.3 Syntax and notations used in plot label


Fixed strings combining with format syntax and notations can be entered into Format String edit box in the Label tab of the Plot Details dialog to construct the desired labels of your plot.

Format strings and notations can include any of the following.

Predefined characters

Characters Description
n, i column and row indices in the source worksheet
x, y, z data point's X, Y, Z coordinates respectively
ix, iy data point's column and row indices when the plot is created from a matrix.
zh data point's Zh coordinate in the 3D ternary

wcol and col are used to refer to a certain column. wcol(n) takes numeric expression as argument and n is the dynamic variable that represents the current column index.

Syntax for Numeric and Date/Time format

Refer to LabTalk substitution notation page for a detailed list of available syntax to format numeric and date/time values.

Belows are some frequently used format strings.

Format String Description Examples
*3* Display number in 3 significant digits, truncating trailing 0.

12.56 --> 12.6
13 --> 13

.4 Display number in 4 decimal places.

12.56 --> 12.5600
13.46857 --> 13.4686

2.2 Display number in 2 decimal places, in power of 2 format.

13 --> 1.63 \times2^{3}

p*3 Display number in 3 significant digits in scientific notation of the form 10^3

52832 --> 5.28 \times10^{4}

S.4 Display number in 4 decimal places, in scientific notation of the form 1E3.

6215369 --> 6.2154E+06

E.3 Display number in 3 decimal places, in engineering format.

6215369 --> 6.215M

L.2 Display number in 2 decimal places, in power of e format

13 --> 1.76 \times e^{2}

##+## Display number by adding a separator + between ten and hundred digits.

6251 --> 62+51

#+##M Display number by adding a separator + between ten and hundred digits and a suffix M.

625 --> 6+25M

#.0% Display number as a percentage of 100 followed by a suffix %.

0.2 --> 20.0% 0.253 --> 25.3%

# ##/## Display number as a fraction with up to 2 digits. If there is the integer part in the mixed number, it will be separated from the remainder by a space.

1.25 --> 1 1/4
0.2 --> 1/5
0.3 --> 3/10

# #/8 Round and display number as a fraction of eighths.

1.25 --> 1 2/8
0.2 --> 2/8
0.3 --> 2/8

DMS Display degree value in the format of degree, minute and second.

37.34255 --> 37°20'30

D1 Display date in the 2nd format from the Display drop down list of the Column Properties dialog.

1/20/2018 -->
Saturday, January 20, 2018 (in English Windows7 OS)

T2 Display time in the 3rd format from the Display drop down list of the Column Properties dialog.

10:05 --> 10:05:00

Notes on Origin's Numeric Notation

  • Origin supports these Custom notations for both plot labeling and worksheet column Display: .n, .n*, *n, *n*.
Syntax for numeric.png
  • To add decimal places to #%, use #.00% (one zero(0) for every decimal place).
  • To display fractions as /100ths, use #/100 or # #/100.
  • To display improper fractions, use #/#. For more precision, use multiple # signs (e.g. ###/###).
  • The basic syntax for DMS is D[Space]M[S][F][n], where square brackets enclose optional elements; and S = seconds, n = digits to indicate decimal places for fractions, and F = file, in which units are not displayed and elements are space-separated.
    Examples:
    DMS = 37°20'30
    D MS = 37° 20' 30
    DMSF = 37 20 30
    DMSF5 = 37 20 30.12345
    DMF1 = 27 20.5
  • Over time, your custom entries list may become cluttered and overly long. To remove custom entries from the list, browse to the User Files Folder (Help: Open Folder: User Files Folder), open your Origin.ini file using a text editor and edit the [Column Custom Format List] section.

Characters for Column Label Rows

Take the following worksheet as example.

LTnotations in label 01.png

The frequently used column label rows are listed below.

Column Label Row Characters Examples
Short Name

G

 %(col(B)[G]$) --> B
Long Name

L

 %(col(B)[L]$) --> Delta Temperature
Units

U

 %(col(B)[U]$) --> K
Comments

C

 %(col(B)[C]$) -->

YBCO milled

Parameters

Pn, where n is the parameter index.

%(col(B)[P1]$) --> Version 2.1
%(col(B)[P2]$) --> 12/15/2004

User-defined Parameters

Dn, where n is the parameter index;

OR

<Real Parameter Name>, if you rename the user-defined parameter.

%(col(B)[Time]$)/%(wcol(n)[D1]$) --> 03:00:39 PM
%(col(B)[D2]$) --> S21
%(col(B)[D3]$) --> 235
%(col(B)[RumNo]$)/%(wcol(n)[D4]$) --> 07

Refer to this page for more characters accessing to column label rows.

Examples

Format String Description
$(wcol(n)[i],*4) Use the numeric value in ith row of the current Y column as label. The value shows in 4 significant digits.
My Label: $(col(Pressure)[i],.3) Prefix "My Label:" followed by value in ith row of Pressure column will be used as label. The value shows in 3 decimal places.
$(col(1)[i],D2) Use the date value in ith row of the first column as label. The date value is displayed in the 3rd format of Display drop down list when you select Date to Format in the Format Cells dialog.
$(col(2)[i], T15) Use the time value in ith row of the second column as label. The Time value is displayed in the 16rd format of Display drop down list when you select Time to Format in the Format Cells dialog.
 %(wcol(n+1)[i]$) %(x$) Use the text in ith row of n+1th column combined with the text of X value as label. n is the current Y column index.
 %(book2,iy,ix) When you create a graph from a matrix, ix and iy refers to the current data point's X and Y indices in the source matrix book. You can put the labels into a workbook, book2 in this example. %(book2,iy,ix) will use the value in cell of iy column and ix row in book2, sheet1 as current data point's label.
 %([book1]sheet2,iy,ix) Similar to %(book2,iy,ix) above. But you can specify the worksheet in this example.
 %(MBook2,ix,iy) Use value in cell (ix, iy) of matrix book MBook2 (the 1st sheet and 1st object) as label. ix and iy are the data point's X and Y indices in the source matrix.
$(Y)%(CRLF)$(p,0)% When you create a stacked graph, you can use this string to display Y value and the corresponding percentile as label. "%(CRLF)" is used to separated the label into two rows. The percentile is shown in integer.
 %(wcol(n)[L]$) Use current Y column's LongName as label.
$(Y*100, .1)% Show Y values in 100%, in 1 decimal place.