2.10.38 plotxyz


Brief Information

Create plot from XYZ data by specifying plot type and properties

Additional Information

Minimum Origin Version Required: 9.0

Command Line Usage

  1. plotxyz iz:=(1,2,3);
  2. plotxyz (1,2,3) plot:=240;
  3. plotxyz iz:=3 plot:=103 hide:=1;
  4. plotxyz (1,2,3) plot:=242 ogl:=<new template:=gl3dbars>; //Add 3d bar plot.
  5. plotxyz iz:=3 plot:=240 ogl:=<new template:=gltraject>; //Add 3d trajectory plot.


X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iz

Input

XYZRange

<active>
Specify the input data, include X column, Y column and Z column.
Plot Type plot

Input

int

103
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

1
Specify whether to rescale the newly created plot on the graph.
  • 1:The plot will be rescaled.
  • 0:The plot will not be rescaled.
Hide Newly Created Graph hide

Input

int

0
Specify whether to hide the output graph.
  • 0:The graph will be shown.
  • 1:The graph will be hidden.
Layer to Plot into ogl

Output

GraphLayer

<new template:=GLMesh>
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.

Description

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.

Examples

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!;


Related X-Functions

plotxy