Create plot from XYZ data by specifying plot type and properties
Minimum Origin Version Required: 9.0
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 | iz |
Input XYZRange |
|
Specify the input data, include X column, Y column and Z column. |
Plot Type | plot |
Input int |
|
Specify the plot type for the output graph. Please note that you may need to also specify the desired template using the ogl variable in order to generate a correct plot. For a complete list of all plot types and their corresponding provided templates, see Plot Type IDs. Note: only the plot types for XYZ range can be used here. |
Rescale | rescale |
Input int |
|
Specify whether to rescale the newly created plot on the graph.
|
Hide Newly Created Graph | hide |
Input int |
|
Specify whether to hide the output graph.
|
Layer to Plot into | ogl |
Output GraphLayer |
|
Specifies the graph layer to add the plot, and also the graph template (both built-in and user-defined) to create plots. For some plot type ID, the default value of ogl may not work, you will need to specify a valid template. |
This x-function generates various kinds of 3D plots from XYZ worksheet data. It also controls whether to rescale the plot or hide the output graph.
This example shows how to plot a 3D bar from discrete columns.
//Import the data file string fn$=system.path.program$ + "\Samples\Statistics\automobile.dat"; impasc fname:=fn$; //Set column types wks.col3.type=6; wks.col4.type=4; wks.col6.type=1; //Select columns from worksheet to generate 3D bar plot plotxyz iz:=(4,6,3) plot:=242 ogl:=<new template:=gl3dbars>; //Turn off the speed mode and refresh the graph. layer.maxpts=0; doc -uw;
This example will create a 3D colormap surface plot and generate a projection contour in the top.
//Import the data file string fn$=system.path.program$ + "\Samples\Graphing\Gaussian Surface.dat"; impasc fname:=fn$; //Set the third column as Z wks.col3.type=6; plotxyz iz:=3 plot:=103 ogl:=<new template:=glcmap>; layer -ip103 %c; range rr = 2; set rr -spf 1; set rr -spz 100;
The following example will plot three sub-ranges into one graph layer as 3D scatter.
//Import the data file string fn$=system.path.program$ + "\Samples\Statistics\Fisher's Iris Data.dat"; impasc fname:=fn$; //Set the third column as Z wks.col3.type=6; //Define the sub ranges range r1=col(3)[1:50]; range r2=col(3)[51:100]; range r3=col(3)[101:end]; //Plot the 3D scatters respectively into the same layer plotxyz iz:=r1 plot:=240 ogl:=<new template:=gl3d>; plotxyz iz:=r2 plot:=240 ogl:=[Graph1]1!; plotxyz iz:=r3 plot:=240 ogl:=[Graph1]1!;