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 Z-values 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 Y-values.

  • 0: Y across columns

Use a row as Y-values and a column as X-values.

  • 1: X across columns

Use a row as X-values and a column as Y-values.

Y Values in / X Values in rowpos

Input

int

<auto>

Specify the row for Y(or X)-values. Whether Y or X-values 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.

  • 0: None
Use column number in the selected range of cells from a worksheet as Y(or X)-values, which starts from 1.
  • 1: 1st row in selection
Use the first row in the selection as Y(or X)-values.
  • 2: 1st row in worksheet
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.
  • 3: Column label
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.
  • 4: Custom
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 Y-values 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.

  • 0: None
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.
  • 4: Custom
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 X-axis title.

Y Title ytitle

Input

string

Y Title

Specify the Y-axis title.

Z Title ztitle

Input

string

Z Title

Specify the Z-axis 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 X-Function 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 X-Function plotvm to plot a contour plot from a worksheet with Y-values in the first row and X-values in the first column.

impASC fname:= system.path.program$+"Samples\Graphing\VSurface 1.dat";
plotvm irng:=1! rowpos:=2 colpos:=2;

Keywords:virtual matrix