Data Presentation - 3D

As of Version 5.0, Figure Composer can create two kinds of 3D plots: a surface mesh much like that generated by Matlab's surf() function; and a 3D scatter, stem or line plot similar to that drawn by Matlab's scatter3(), stem3(), or plot3() functions, respectively. Examples of some of these plots are shown in the figure below. [The examples also illustrate two different backdrop styles available for the graph3d container; the surface plot is rendered on an xyPlane backdrop, while the stem plot uses the axesBack backdrop.]

Some 3D Plots in FC

3D Scatter/Line Plot Properties

The FypML scatter3d node is the 3D data presentation node that renders a set of discrete 3D points {x, y, z} as a scatter, bubble, stem or line plot within a 3D graph. It currently supports a single FypML data format, xyzset. It does not render standard deviation data. It offers the same four display modes as its 2D counterpart, although the various "bubble" modes are less important here because the plot symbols are drawn in 3D space. Unlike the 2D version, scatter3d also supports drawing a stem line from each 3D data point to a stem base plane, Z=Zo. If the stem baseline constant Zo is outside the 3D graph's current Z-axis range, then the graph's XY backplane serves as the stem base plane.

The screenshot on the right shows the property editor for the scatter3d node. The first two rows of widgets in the editor panel are common to the property editors for all of the different data presentation elements in FC. In the first row you can specify a title for the element. Not only does a unique title help you identify the object in the Figure Navigator's node tree, but it is also used to label the corresponding entry in the parent graph's automated legend. To include the scatter plot in the legend, check the box just to the left of the title field. 

The second row displays the id of the source data set, along with three pushbuttons. Press the Edit button to raise the Dataset Editor Dialog, in which you can view and/or modify the data set by hand. The other buttons raise a file chooser so that you can either load a different data set from an external source file, or save the current data set to file. See the chapter on Loading Data for more information.

The combo box on the third row selects the display mode

Unlike its 2D counterpart, scatter3d supports a gradient fill for the marker symbols. The background fill picker widget on the Symbols tab selects the background fill for the markers. The primary reason for this feature is to support a radial gradient fill -- a radial fill with a circular or oval symbol type will create the "illusion" of a 3D symbol via a false lighting effect; the effect is illustrated in the stem plot example at the top of this page. [Note that, in the colorBubble and colorSizeBubble display modes, if a gradient background fill is selected, it is the gradient's second color stop which varies with Z. In this scenario, you'll want to make sure that the first color stop is a color that does not appear in the graph's color map and that contrasts adequately when paired with any color in that map.]

To render a stem plot, ensure the the Stems radio button is selected on the Line/Stems tab and enter the desired stem baseline constant Zo in the Stem Base Z field. To render a 3D line plot, choose the Traced radio button instead; in this case, the stem baseline is irrelevant, and the stem lines are replaced by a single, piecewise continuous trace line that connects all valid data points in the set. If you want only a scatter or bubble plot without stem lines or a connecting trace line, simply set the stroke width to 0 or the stroke color to transparent on the Line/Stems tab.

Surface Properties

The FypML surface node is essentially the 3D version of the 2D heatmap node. It renders an xyzimg data set as a polygon mesh in the 3D world defined by its graph3d parent. For each value of (X, Y) in the data source and mesh cell dimensions (DX, DY), FC computes the vertices (X, Y, Z1), (X+DX, Y, Z2), (X+DX, Y+DY, Z3), and (X, Y+DY, Z4) from the data source. These are projected onto the 2D canvas using the graph3d container's perspective projection, which generally results in a 4-sided polygon in 2D. Each such polygon is stroked IAW the surface node's stroke properties (solid strokes only), which are set by the widgets on the last row of the Surface Properties editor -- see screenshot on the right. If the stroke width is 0, then this "mesh" is not drawn. The polygon fill depends on the Color-mapped? check box. If the box is not checked, then all polygons in the surface mesh are filled IAW the node's current fill color; otherwise, each polygon is filled with the color that maps to its assigned Z-value, as determined by the parent graph's current color map. The Z-value of a mesh polygon is the average value of Z across its vertices (plus any "skipped" samples within the mesh cell due to sub-sampling to limit mesh count). Thus, you can render the surface as a "wire frame" mesh (uncheck Color-mapped? box and set fill color to transparent), a single-color or color-mapped surface (like a 3D heat map), or both. In the example figure at the top of this page, the surface is color-mapped without a wire frame.

The xyzimg data source can be thought of as an NxM matrix of Z-values sampled over a regular grid in XY space. The data set parameters specify the range [X0..X1] spanned by the data in X and the range [Y0..Y1] spanned in Y. Thus, the mesh cell dimensions are DX = (X1-X0)/N and DY = (Y1-Y0)/M, and FC can calculate the values of X and Y for each value of Z in the matrix. N is the mesh size in the X direction, while M is the mesh size in the Y direction. As mesh size increases, the time it takes to render the surface increases dramatically. As a compromise between rendering speed and fidelity, the Mesh Limit attribute specifies a maximum mesh size, S; its allowed range is [25..500]. As long as max(N,M) <= S, the entire data set is plotted without "sub-sampling". If, say N > S, then we find the smallest integer k >= 2 such that N/k <= S. Then the mesh cell dimension in X will be DX*k. In computing the average Z value assigned to a mesh cell, the value at each "skipped" vertex is included in the average, unless the value is NaN. An analogous approach applies to the Y dimension when M > S.

What if the data set contains NaN values? As long as the Z value is well-defined at each of the four vertices of the mesh cell, the projected polygon is rendered. If any of the four vertices is ill-defined, nothing is drawn for that mesh cell -- leaving a "hole" in the surface.

3D Scatter/Line Plot Properties Editor
Surface Properties Editor