XYZCreate creates a new 3D dataset. The 3D dataset can be created from scattered XYZ triples or from a rectangular grid (matrix).
Return Value
hData is the handle of the dataset. If the dataset cannot be created hData is 0.
Parameters
ssName is a scalar string.
rvX is a vector with x-coordinates.
rvY is a vector with y-coordinates.
rvZ is a vector with z-coordinates.
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 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 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 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). |
See also
Overview XYZ-Datasets, Overview Data File Informations for Datasets, LayerAddDataset, XYZDestroy, XYZCreateFromMatrix, XYZGetMatrixRange, XYZGetMatrix, XYZGetData, XYZGetMatrixRowData, XYZGetMatrixColData
id-428507