Create contour, image or heatmap plot from a range of worksheet cells
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.
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.
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | irng |
Input Range |
|
Specify Z-values or an existing virtual matrix to plot. Use dend to speicfy the dynamic end column/row. |
Data Layout | format |
Input int |
|
Specify which way to set the X- and Y-values.
Use a row as Y-values and a column as X-values.
Use a row as X-values and a column as Y-values. |
Y Values in / X Values in | rowpos |
Input int |
|
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.
|
Y Range | rowrng |
Input Range |
|
|
Column Label | label |
Input string |
|
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.
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 |
|
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 |
|
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.
|
X Range | colrng |
Input Range |
|
|
Format X/Y Data | coltype |
Input string |
|
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 |
|
Specify the X-axis title. |
Y Title | ytitle |
Input string |
|
Specify the Y-axis title. |
Z Title | ztitle |
Input string |
|
Specify the Z-axis title. |
Virtual Matrix Name | vmname |
Input string |
|
Specify the name of virtual matrix. |
Plot Type | type |
Input int |
|
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 |
|
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 |
|
Specify the graph layer to add plots. See the syntax here. |
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.
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