Previous topic

XYZCopyConfig

Next topic

XYZCreateFromMatrix

This Page

XYZCreateΒΆ

XYZCreate creates a new 3D dataset. The 3D dataset can be created from scattered XYZ triples or from a rectangular grid (matrix).

hData = XYZCreate(ssName, rvX, rvY, rvZ)
hData = XYZCreate(ssName, rvX, rvY, rvZ, bIsoScale)
hData = XYZCreate(ssName, rvX, rvY, rvZ, bIsoScale, svWOT)
hData = XYZCreate(ssName, rvX, rvY, rmZMatrix)
hData = XYZCreate(ssName, rvX, rvY, rmZMatrix, bIsoScale)
hData = XYZCreate(ssName, rmZMatrix, rvRect)

Return Value

hData is the handle of the dataset. If the dataset cannot be created hData is 0.

Parameters

ssName

ssName is a scalar string.

rvX

rvX is a vector with x-coordinates.

rvY

rvY is a vector with y-coordinates.

rvZ

rvZ is a vector with z-coordinates.

rmZMatrix

rmZMatrix is a matrix with z-coordinates. If the distance between the rows and columns of the matrix is constant, the x- and y-coordinates can be specified with the rvRect parameter. If the rows and columns are not evenly spaced, the coordinates of the matrix columns are specified by the vector rvX and the rows are specified by the vector rvY. rvX and rvY should be sorted in ascending order. If they are not sorted the function will sort the vectors and the z matrix.

rvRect

rvRect specifies the range of the z Matrix in the xy plane.

Value Meaning
rvRect[1] xmin of the first matrix column
rvRect[2] ymin of the first matrix row
rvRect[3] xmax of the last matrix column
rvRect[4] ymax of the last matrix row
bIsoScale

bIsoScale is TRUE (1), if isolines should be automatically created for the dataset, and FALSE (0), when no isolines should be created. If the function is called with 4 parameters TRUE will be used for bIsoScale.

svWOT

svWOT is a string vector that sets the Full Load Line (WOT). Each vector element contains a symbol and can have one of the following values "a", "e", "v", "A", "E", "V", "". The symbols have the following meanings:

Value Meaning
“a” Start of the Full Load Line (WOT) without labels.
“e” End of the Full Load Line (WOT) without labels.
“v” Point belongs to Full Load Line (WOT) and will not be labeled.
“A” Start of the Full Load Line (WOT) with labels.
“E” End of the Full Load Line (WOT) with labels.
“V” Point belongs to Full Load Line (WOT) and will be labeled.
“” (empty string) Point does not belong to Full Load Line (WOT).

Comment

All vectors must have the same number of elements for XYZ triples. The triples can be scattered in the x/y plane. At least three triples are necessary to create a 3D dataset. If the function is called without the parameter svWOT, a convex hull is calculated.

If the dataset is created from a matrix, the data hull can be specified by using the function XYZSetHullNewData.

Example

Copy the following example into an UniPlot Editor (File=>New [Program editor]) and choose UniScript=>Save/Execute to execute the script.

A 2 by 3 matrix dataset will be created. The x-coordinates specify the columns and the y-coordinates the matrix rows.

x = [1, 1.5, 2]
y = [1, 5]
z = [1, 1, 3;
    1, 2, 3]
hData = XYZCreate("Test", x, y, z);
if (hData == 0) {
    error();
}
hLayer = LayerCreate();
hDoc = DocCreate();
hPage = PageCreate();
DocAddPage(hDoc, hPage);
PageAddLayer(hPage, hLayer);
LayerAddDataset(hLayer, hData);
LayerAutoScale(hLayer);
PageReplot(hPage);

History

Version Description
5.3.4 Function call with three parameters fixed: XYZCreate(ssName, rmZMatrix, rvRect).

id-428507