3D Graphs
Surface meshes and other kinds of three-dimensional plots first became possible in Figure Composer 5.0 with the introduction of the graph node's 3D counterpart, the graph3d element. A 3D Cartesian coordinate system XYZ -- and all data sets therein -- are rendered in perspective on the two-dimensional figure canvas. While a number of different backdrop styles are offered, the 3D graph container is typically presented as a rectangular box with the X, Y, and Z axes drawn adjacent to its outer edges. As shown in the example on the right, the three back sides of this box are normally filled, while the three front faces are hidden. Grid lines may be drawn within the backplanes. Rotation and elevation angles let you adjust the orientation of the coordinate system in 3D space to find the optimum view of the data presented.
[Technical note: The perspective projection encapsulated by graph3d governs the rendering of the 3D backdrop -- including all axes, tick marks, and gridlines -- and all 3D data presentation nodes contained in the graph. However, graph3d can also contain generic text labels, text boxes, shapes, images, and line segments as child nodes. These nodes do not have a Z-coordinate; so they can only positioned in a 2D viewport. The 3D graph's 2D viewport is defined by the rectangle that bounds the 2D projection of the 3D box backdrop (excluding axes) onto the figure canvas; as usual, the origin of this viewport is at the bottom-left corner of the rectangle. For best results, it is best to use relative units ("%") to position labels and other generic graphic objects with respect to their 3D graph parent.]
Like the graph element, graph3d can be thought of as a single composite graphic object with 10 required component nodes. Three axis nodes define the graph's X/Y/Z axes, three back3d elements control the appearance of the XY, XZ, and YZ backplanes, three gridline elements specify the stroking style for the X/Y/Z gridlines, and a legend node specifies the location and layout of the auto-generated legend. These individual components are not accessible from the Figure Navigator's node tree. Instead, all of the properties of the 3D graph and its component parts are displayed and edited in the 3D Graph Properties editor. As you can see in the screenshots on this page, separate tabs on the editor panel are dedicated to the graph backdrop (backplanes and gridlines), the three axes, and the automated legend.
The Main tab exposes properties that set the location of the 3D graph within its parent figure, its physical dimensions in 3D space, and other factors that define the perspective projection of that 3D space onto the figure canvas:
(X,Y) locates the origin of the 3D coordinate system in the parent figure's 2D viewport. In the perspective projection, that viewport lies in the projection plane.
W is the measured width of the 3D data box, that is, the box's extent along the X dimension in 3D space. The X-axis range maps to this extent.
H is the measured height of the 3D data box, or its extent along the Y dimension in 3D space.
D is the measured depth of the data box, or its extent along the Z dimension in 3D space.
S is the projection scale factor, an integer limited to [2..20]. The projection distance -- i.e., the distance from the camera viewpoint to the coordinate system origin -- is set to S*max(W,H,D). The smaller S, the more the distorted the projection.
θ(Z), θ(X) are the rotation and elevation angles that determine the orientation of the XYZ coordinate system in 3D space. The origin is fixed, and the coordinate system is first rotated by θ(Z) about its Z axis, then subsequently rotated by θ(X) about its X axis. Both angles are in degrees counterclockwise.
The Color Map combo box selects the color map assigned to the 3D graph (for a 2D graph, the color map is a property of the graph's special "color axis"). As in the 2D context, it is used to map Z-coordinate data to a range of RGB colors. Currently, FC supports 10 different color maps -- go here for a complete description (but note that, unlike the color map for a 2D graph, there's no "NaN color" in the 3D graph's color lookup table).
The text field at the top of the Main tab shows the graph's title. This is only for labeling purposes -- notice that the Figure Navigator displays the title in the graph's entry in the node tree. The title string is NOT rendered anywhere on the graph. If you want to place a title somewhere on the graph, add a label or textbox object to it (or the parent figure).
Note the field labeled "ID (optional)" just underneath the title field. If it is a non-empty string, this "graphic object ID" serves to uniquely identify the 3D graph. Like the title, the ID is never rendered in any way. It is really intended for use outside of Figure Composer -- it provides a way to programmatically locate a particular label, text box or graph within an existing FypML figure, so that you can modify the content of the label or text box, replace the graph with a different one, and so on. If you have no need for the object ID, simply leave it blank.
The 3D graph's backdrop comes in one of five possible styles, as selected by the combo box at the top of the Backdrop tab page:
box3D : The typical 3D box backdrop, with XY/XZ/YZ backplanes drawn along with the three forward-facing edges that "complete" the box. The three front sides are "see-through". Gridlines, if specified, are drawn within the backplanes, and the axes are drawn adjacent to the corresponding edges of the 3D box. The X- and Y-axes are either above or below the box, while the Z-axis is on the left or right -- all depending on the current orientation of the XYZ coordinate system.
openBox3D : Same as box3D, except that the three forward-projecting edges are omitted. The 3D graph at the top of this page is configured in this backdrop style.
xyPlane : Same as openBox3D, but the XZ and YZ backplanes (and any gridlines therein) are hidden.
axesOuter : Same as openBox3D, but all backplanes and gridlines are hidden. Only the axes are drawn along the corresponding outside edges of the 3D data box.
axesBack : This is how the axes of a 3D graph might typically appear in a mathematics text, with the axes emanating from the back-bottom corner of the 3D data box. No backplanes or gridlines are drawn.
hidden : The backdrop is hidden altogether. No axes, backplanes or gridlines are drawn.
The other widgets on the Backdrop tab control the appearance of the XY/XZ/YZ backplanes and the X/Y/Z gridlines. There are separate controls for each backplane and each set of gridlines, so you have a lot of flexibility in designing your 3D backdrop. You can hide any backplane by setting both its fill and stroke colors to transparent; you can hide a gridline set by setting its stroke color to transparent or its stroke width to zero.
The remaining tabs in the 3D Graph Properties editor govern the three axes, their associated tick marks, and the automated legend. The Legend tab is identical to its 2D counterpart. The screenshot on the right shows the X-axis tab; the Y- and Z-axis tabs are identical, and they are all very similar to the X and Y tabs in the 2D Graph Properties editor. There are a few significant differences, however:
In the 2D case, whether an axis is scaled logarithmically or linearly is determined by the graph node's coordinate system type (cartesian, loglog, etc.). In the 3D case, check the Log? box to make the axis logarithmic; else it is linear. The logarithmic base is 2 or 10, depending on whether or not the Base2? box is checked.
In the 2D case, the start S and end E of the axis range could be any value. For the 3D graph, FC requires that S < E; furthermore, if the axis is logarithmic, 0 < S < E. Whenever these constraints are not met, the axis range is auto-corrected and the relevant widgets are updated accordingly.
The Units token is omitted in the 3D case; it applies only to the rendering of calibration bars, which currently are available only in the 2D graph.
A 3D tick mark set will not "track" the range of the parent axis, so the Track? check box present on any Ticks tab panel for a 2D graph is omitted in the 3D context. Furthermore, the start S and end E of the tick set range must always satisfy the constraint S < E, and the tick interval must be strictly positive.