Retrieving Plot Data
Each plot is made up of one or more groups or parts. Most plots contain only one group, such as Surface or Line plots, whereas for example Slice plots contain one group per slice. Retrieve the number of groups with the method
plot.getGroups(<renderIndex>)
where plot is any plot feature.
Retrieving the groups requires that you specify a render index for which you want the number of groups. Each plot is made up of one or more internal, or rendering, plot types. For example, particle tracing can contain both lines and spheres, which are separate rendering types. Most plot have only a single rendering type, in which case you can safely use 0 as the render index. The group index property indicates groups or parts within the rendering group index.
Extract the data contained in any plot feature using the following methods:
p = plot.getVertices(<renderIndex>, <groupIndex>) returns a float matrix containing one row for each dimension and one column for each vertex.
t = getElements(<renderIndex>, <groupIndex>) returns the indices to columns in p of a simplex mesh, each column in t representing a simplex.
d = getData(<renderIndex>, <groupIndex>, <dataType>) returns a float array containing the data for each point in p. The type of data to retrieve is given by the String <dataType>:"Color", "Height", and so forth.
To retrieve the available data types, use:
types = getDataTypes(<renderIndex>)
which returns a string array with the data types currently present in the plot.
For plot features, you can retrieve the point normals using the following method:
n = getNormals(<renderIndex>, <groupIndex>)
which returns a floating-point matrix of point normals with each column corresponding to a single vertex.
Example
int renderDataGroups = plot.getRenderGroups();
 
for (int ri = 0; ri < renderDataGroups; ri++) {
 
   String[] dataTypes = plot.getDataTypes(ri);
   int plotDataGroups = plot.getGroups(ri);
   for (int gi = 0; gi < plotDataGroups; gi++) {
      p = plot.getVertices(ri,gi);
      t = plot.getElements(ri,gi);
      //d = plot.getData(ri, gi, "Color");
      d = plot.getData(ri, gi, dataTypes[0]);
   }
}
Retrieving Axis Units
Use model.result(<feature>).getAxisUnits() to return the units of the coordinate axes for the plot group to which the feature belong; null for 1D plot groups. This method returns a string array of length 2 or 3 containing LaTeX-formatted units.