2.10.23 plotvm
Brief Information
Create contour, image or heatmap plot from a range of worksheet cells
Additional Information
Minimum Origin Version Required: 8.5 SR0
The option to hide the resulting graph became available in 9.0.
The vmname, coltype, rowtype variables are introduced from Origin 2015.
The dend to support dynamic end column/row are instroduced from Origin 2018b.
Command Line Usage
1. plotvm irng:=1!!5:dend;
2. plotvm irng:=1! rowpos:=2 colpos:=2;
3. plotvm irng:=1!2[3]:4[5] rowpos:=4 rowrng:=[1]:[1] colpos:=4 colrng:=1;
4. plotvm irng:=1! ztitle:="VSurface 1" type:=242 ogl:=[<new template:=cmap>];
5. plotvm irng:=1! rowpos:=label label:=L rowtype:=T0 colpos:=selcol1 coltype:=D0 ogl:=<new template:=heatmap>;
6. plotvm irng:=VM1; //Use virtual matrix "VM1" to create contour plot.
Variables
Display Name

Variable Name

I/O and Type

Default Value

Description

Input

irng

Input
Range

<active>

Specify Zvalues or an existing virtual matrix to plot. Use dend to speicfy the dynamic end column/row.

Data Layout

format

Input
int

0

Specify which way to set the X and Yvalues.
Use a row as Yvalues and a column as Xvalues.
Use a row as Xvalues and a column as Yvalues.

Y Values in / X Values in

rowpos

Input
int

<auto>

Specify the row for Y(or X)values. Whether Y or Xvalues are specified is determined by the value of format.
Note that Y(or X)values in the row should be in descending or ascending order.

 Use column number in the selected range of cells from a worksheet as Y(or X)values, which starts from 1.
 Use the first row in the selection as Y(or X)values.
 Use the first row in the worksheet as Y(or X)values. Note that if only a range of a worksheet is specified in irng, only the corresponding part of the first row in the worksheet is used as Y(or X)values.
 Use the column labels in the worksheet as the Y(or X)values. Column Label row is specified in label. Note that if only a range of a worksheet is specified in irng, only the corresponding part of the Column Label row in the worksheet is used as Y(or X)values.
 Specify a row in the worksheet.

Y Range

rowrng

Input
Range

<unassigned>

 Specify a row for Y(or X)values. rowrng should be specified only when rowpos is set to 4.
 Note that rowrng should be in the same worksheet of irng.

Column Label

label

Input
string

<unassigned>

Specify a string for Column Label whose row is used as Y(or X)values. label should be specified only when rowpos is set to 3.
 "Long Name"{L}:Long Name
 Use Long Name row as Y(or X)values.
 "Units"{U}:Units
 Use Units row as Y(or X)values.
 "Comments"{C}:Comments
 Use Comments row as Y(or X)values.
 <custom>:Parameters 1
 Use Parameters 1 row as Y(or X)values.
Note: It needs to use a single character to specify the column label row in script. Please refer to Column Label Row Characters for the single character of each column label row.

Format Y/X Data

rowtype

Input
string

<unassigned>

Specify the data format of the X/Y data. This variable is only accessible when the rowpos variable is not set to 0 (None). You can refer to supported Origin Formats notation for details.

X Values in / Y Values in

colpos

Input
int

<auto>

Specify the column for X(or Y)values. Whether X or Yvalues are specified is determined by the value of format.
Note that X(or Y)values in the column should be in descending or ascending order.

 Use row number in the selected range of cells from a worksheet as X(or Y)values, which starts from 1.
 1: 1st column in selection
 Use the first column in the selection as X(or Y)values.
 2: 1st column in worksheet
 Use the first column in the worksheet as X(or Y)values. Note that if only a range of a worksheet is specified in irng, only the corresponding part of the first column in the worksheet is used as X(or Y)values.
 3: X column to the left of the selection
 Use the nearest X column to the left of the range of irng as X(or Y)values. It can be specified only when there is at least one X column on the left side of the range of irng.
 Specify a column in the worksheet.

X Range

colrng

Input
Range

<unassigned>

 Specify a column for X(or Y)values. colrng should be specified only when colpos is set to 4.
 Note that colrng should be in the same worksheet of irng.

Format X/Y Data

coltype

Input
string

<unassigned>

Specify the data format of the X/Y data. This variable is only accessible when colpos variable is not set to 0 (None). You can refer to supported Origin Formats notation for details.

X Title

xtitle

Input
string

X Title

Specify the Xaxis title.

Y Title

ytitle

Input
string

Y Title

Specify the Yaxis title.

Z Title

ztitle

Input
string

Z Title

Specify the Zaxis title.

Virtual Matrix Name

vmname

Input
string

VM1

Specify the name of virtual matrix.

Plot Type

type

Input
int

226

Specify the plot type for 3D or contour graph.
For details about plot types, see Plot Types in Labtalk.

Hide Newly Created Graph

hide

Input
int

0

Specify whether to hide the newly created graph. Note that this option is hidden in the dialog. One can only assign its value through Labtalk script.


ogl

Output
GraphLayer

[<new template:=contour>]

Specify the graph layer to add plots.
See the syntax here.

Description
This XFunction plots 3D or contour graph from a range of cells in a worksheet as a virtual matrix. It provides several options to define Y(or X)values.
Note that plotvm supports uneven x or y spacing of values to plot 3D or contour graph.
For details about the use of plotvm dialog in Origin's menu, see Creating 3D and Contour Graphs from Virtual Matrix.
Example
The following script uses the XFunction plotvm to plot a contour plot from a worksheet with Yvalues in the first row and Xvalues in the first column.
impASC fname:= system.path.program$+"Samples\Graphing\VSurface 1.dat";
plotvm irng:=1! rowpos:=2 colpos:=2;
Keywords:virtual matrix
