3.3.2.22 Get

Brief Introduction

Gets (reads) the value of a certain attribute of the dataset, data plot, or worksheet specified by name.

Syntax

get name option [variableName]

Specifying Worksheet, Dataset or Data Plot

We usually specify worksheet, dataset or data plot by name.

  • If name is a worksheet, all datasets on the worksheet are affected.
  • If name is a dataset or data plot, only that dataset or data plot is affected.

As of Origin 2017, name can refer to multiple plots of the same worksheet dataset, using a Book_N:n syntax.

Specifying Data Point

We can specify the data point by providing a number after the dataset name. For example:

get %C 13 -c nn; //This gets the color of 13th datapoint in the plot

If custom increment list is not enabled, the color index value follows the default list of colors, but if custom increment list is enabled, the color index value follows the custom list defined in the Color List tab.

Note: This datapoint notation can be only applied to the following options:
Scatter/Symbol+Line Related Option -z , -c , -cse , -csf , -k , -ka , -kf , -lh , -lhc , -lhs , -lhw , -lv , -lvc , -lvs , -lvw
Bar/Column Related Option -pbc , -pbs , -pbw , -pfb , -pfc , -pfp , -pfw

Specifying Pattern

From Origin 2017 SR1, if you want to set the pattern properties for a multiple pattern plot, you can specify the pattern index after “p” in option directly. That is to say, p is the first pattern, p2 is the second pattern, p3 is the third pattern and etc.For example:

//plot two lines that intersect with each other before executing code
set %c -pf 1; //Turn the fill area option on 
set %C -pfv 9; //Set the the Fill Area Under Curve to "Fill to next data plot –Above Below Colors"
get %C -pfb n1; //Get the color of "Pattern Above"
get %C -p2fb n2; //Get the color of "Pattern Below"
Note: This pattern notation can be only applied to the following options:
Bar/Column Related Option -pfb, -pfc, -pfm, -pff, -pfp, -pfw

Options

This command places the return value into variableName. If variableName is absent, the value is placed into the variable v1. The option switch determines what value is placed into variableName or v1.

Options for Columns

Option Description
-b Get the beginning of the display range
-b3o Get the start value of the 3D Bars
-b3co Get fill type of 3D surface plot
-b3cd Get dataset name of 3D surface plot fill
-e Get the end of the display range
-f Get the corresponding X value
-hbb Get the histogram lower bin value
-hbe Get the histogram upper bin value
-hbs Get the histogram bin size
-i Get the X increment for the name dataset
-it Get the internal data type
-paal Get whether pattern follow line transparency
-paap Get whether pattern transparency for Fill Only
-set Get whether the Text & Numeric datasets show numeric values as text elements or numeric

Options for Data Plots

Option Description
-c Get the line color and symbol edge color
-cd Get the dataset to define the plot line and symbol edge color
-cf Get the fill color
-ci Get the start color index when the plot line color and symbol edge color is increment
-cld Get the dataset to control line color
-cli Get the start color index of plot line color increment
-clm Get the source data set when the plot line color is colormap
-cln Get the source data of the plot line color indexing
-clo Get the line color type
-clr Get source dataset for RGB values of the plot line color
-cmn Get the color index for level n
-cm Get the source dataset for the colormap of plot line and symbol edge color
-cn Get the source dataset for the color indexing of plot line and symbol edge color
-co Get the method to define the plot line and symbol edge color
-cr Get the source dataset used to define the RGB values of the plot line color and symbol edge color
-cse Get the index of symbol edge color
-csed Get the dataset to control symbol edge color
-csei Get start color of symbol edge color increment
-csem Get the dataset for symbol edge color mapping
-csen Get the dataset for symbol edge color indexing
-cseo Get the symbol edge color type
-cser Get the dataset for RGB values of symbol edge color
-cset Get the plot symbol edge color pattern
-csf Get the symbol fill color index
-csfd Get the dataset to control symbol fill color
-csfi Get start color index of symbol fill color increment
-csfm Get the dataset for symbol fill colormapping
-csfn Get the dataset for symbol fill color indexing
-csfo Get the symbol fill color type
-csfr Get the dataset for RGB values of symbol fill color
-cu Get the custom color increment list of the line plot as a dataset
-cue Get the status of custom color increment list
-cuf Get the custom increment color list for pattern fill
-cus Get the custom increment color list for symbol edge
-cusf Get the custom increment color list for symbol fill
-czn Get the color value for Z level
-gtl Get the leader line to symbol gap
-gtt Get the gap between leader line and label
-paaf Get whether plot Transparency for Fill Only
-pgpa Get the pie or doughnut starting azimuth (deg.)
-pgpd Get the enable doughnut status (pie or doughnut)
-pgpdh Get the pie or doughnut hole size
-pgpho Get the pie or doughnut horizontal offset
-pgpva Get the 3D pie view angle
-sx Get the X offset value for a data plot
-sxs Get the scaling factor of X value after stacking for a data plot
-sy Get the Y offset value for a data plot
-sys Get the scaling factor of Y value after stacking for a data plot

Options for Lines

Option Description
-d Get the line style index number
-dn Get name of indexing line style
-l Get the line connection method
-ldf Get the dash lines setting
-lfp Get the worksheet column that is the Fill to Data Plot dataset
-lh Get whether drop lines along X direction are displayed
-lhc Get the horizontal drop line color
-lhs Get the horizontal drop line style
-lhw Get the horizontal drop line width
-lo Get whether drop lines along Z direction are displayed
-lv Get whether drop lines along Y direction are displayed
-lvc Get the vertical drop line color
-lvs Get the vertical drop line style
-lvw Get the vertical drop line width
-w Get line width. Units are pts X 500. Also gets connecting line width, provided the connecting line has an associated Line tab in Plot Details (e.g. connecting lines in stacked bar graph but not connecting lines in box plots).
-wn Get name of indexing line width
-wp Get line width. Units are pts (see -w, above).

Options for Symbols

Option Description
-k Get the symbol shape
-kb Get whether the data labels display in bold font style
-kh Get the symbol edge thickness
-ki Get whether the data labels display in italic font style
-kn Get the font index
-ku Get whether the data labels display with an underline
-paas Get whether symbol follow line transparency
-z Get the data point symbol size

Options for Text Labels

Option Description
-tf Get the data label font
-tj Get the data label justification
-tr Get the data label text rotation angle in degrees
-ts Get the data label font size in points
-tx Get the x offset for the data label
-ty Get the y offset for the data label

Options for Bar and Column Plots

Option Description
-pbc Get the bar or column border color
-pbcd Get the dataset to control bar or column border color
-pbci Get start color index of bar or column border color increment
-pbcm Get the dataset for bar or column border colormapping
-pbcn Get the dataset for bar or column border color indexing
-pbco Get the column border color type
-pbcr Get the dataset for RGB values of bar or column border color
-pbs Get the bar or column border line style
-pbw Get the bar or column border width
-pd Get whether vertical drop lines are displayed
-pf Get whether the fill area option is enabled
-pfb Get the bar or column background color
-pfbd Get the dataset to control bar or column fill color
-pfbi Get start color index of bar or column fill color increment
-pfbm Get the dataset for bar or column fill colormapping
-pfbn Get the dataset for bar or column fill color indexing
-pfbo Get the column fill color type
-pfbr Get the dataset for RGB values of bar or column fill color
-pfc Get the bar or column fill pattern color
-pfcd Get the dataset to control bar or column pattern color
-pfci Get start color index of bar or column pattern color increment
-pfcm Get the dataset for bar or column pattern colormapping
-pfcn Get the dataset for bar or column pattern color indexing
-pfco Get the column pattern color type
-pfcr Get the dataset for RGB values of bar or column pattern color
-pff Get bar or column gradient fill color
-pffd Get the dataset to control bar or column gradient fill color
-pffi Get start color index of bar or column gradient fill color increment
-pffm Get the dataset for bar or column gradient fill colormapping
-pffn Get the dataset for bar or column gradient fill color indexing
-pffo Get the column gradient fill color type
-pffr Get the dataset for RGB values of bar or column gradient fill color
-pfm Get the mode of gradient fill
-pfp Get the bar or column fill pattern
-pfpd Get the dataset for bar or column fill pattern indexing
-pfpi Get start pattern index of bar or column fill pattern increment
-pfw Get the fill pattern line width
-pt Get the data plot ID
-vox Get the X direction bar width for 3D bars (XYY, XYZ), in percentage.
-voy Get the Y direction (3D XYY) or Z direction (3D XYZ) bar width, in percentage.

Options for Data Plot Labels

Option Description
-qb Get whether the data label is font bold
-qi Get whether the data label is font italic
-qu Get whether the data label with underline

Other Options

Option Description
-gn Get the LongName of the plot group in which the specified data plot is.
-m Get dataset movability with the cursor
-nhw Get the histogram bin worksheet name
-nhwc Create the histogram bin worksheet
-pfv Get the area plot fill-area-under-curve setting
-pfn Get the mode of Fill to next data plot
-s Get whether the data plot is hidden
-skip Get the skip value for a dataset

Examples

Example 1

The following script finds the display range of a dataset by setting variables BeginIndex and EndIndex.

range rr = [Book1]Sheet1!B;
get rr -b BeginIndex;
get rr -e EndIndex;

Example 2

Get the properties of a Symbol plot:

get %C -z Size;
get %C -k Shape;
get %C -kf interior;
type Symbol size is $(size) using shape $(shape) and Interior $(interior);
if(interior==1||interior==2||interior>7)
{
   get %C -cse color1; // These are two color types
   get %C -csf color2;
   type With Edge Color $(color1) and Fill Color $(color2);
}
else
{
   get %C -c color; // These are one color types
   type With Color $(color);
}

Example 3

Get the properties of lines in a plot:

range rPlot = [Graph1]Layer1!1;
get rPlot -l LC;
get rPlot -d LS;
get rPlot -c Color;
get rPlot -w Width;
type Using Line Connection $(LC) with Style $(LS), 
type Color $(color) and Width $(width/500) Pts.;

Example 4 Get the dataset for custom color list when custom color list is used:

get %c -cue nn;
if(nn==1)
{
  dataset ds;
  get %C -cu ds;
  newbook;
  col(A)=ds;
}
else
  type "Custom Color List is not used in active plot";

See Also

Set (command)