Labeling Three-Dimensional Graphics

The Wolfram Language provides various options for labeling three-dimensional graphics. Some of these options are directly analogous to those for two-dimensional graphics, discussed in "Labeling Two-Dimensional Graphics". Others are different.

Some options for labeling three-dimensional graphics.

The default for (RefLink[Graphics3D, paclet:ref/Graphics3D]) is to include a box, but no other forms of labeling:

Graphics3D[PolyhedronData["Dodecahedron","GraphicsComplex"]]

Setting (RefLink[Axes, paclet:ref/Axes])->(RefLink[True, paclet:ref/True]) adds x, y, and z axes:

Show[%,Axes->True]

This adds grid lines to each face of the box:

Show[%,FaceGrids->All]

Style options.

This makes the box dashed, and draws axes that are thicker than normal:

Graphics3D[PolyhedronData["Dodecahedron","GraphicsComplex"],BoxStyle->Dashing[{0.02,0.02}],Axes->True,AxesStyle->Thickness[0.01]]

By setting the option (RefLink[Axes, paclet:ref/Axes])->(RefLink[True, paclet:ref/True]), you tell the Wolfram Language to draw axes on the edges of the three-dimensional box. However, for each axis, there are in principle four possible edges on which it can be drawn. The option (RefLink[AxesEdge, paclet:ref/AxesEdge]) allows you to specify on which edge to draw each of the axes.

Specifying where to draw three-dimensional axes.

This draws the x on the edge with larger y and z coordinates, draws no y axis, and chooses automatically where to draw the z axis:

Show[%,Axes->True,AxesEdge->{{1,1},None,Automatic}]

When you draw the x axis on a three-dimensional box, there are four possible edges on which the axis can be drawn. These edges are distinguished by having larger or smaller y and z coordinates. When you use the specification {(Subscript[dir, y]),(Subscript[dir, z])} for where to draw the x axis, you can set the (Subscript[dir, i]) to be +1 or -1 to represent larger or smaller values for the y and z coordinates.

Axis labels in three-dimensional graphics.

You can use (RefLink[AxesLabel, paclet:ref/AxesLabel]) to label edges of the box, without necessarily drawing scales on them:

Show[PolyhedronData["Dodecahedron"],Axes->True,AxesLabel->{"x","y","z"},Ticks->None]

Settings for the (RefLink[Ticks, paclet:ref/Ticks]) option.

You can give the same kind of tick mark specifications in three dimensions as were described for two-dimensional graphics in "Labeling Two-Dimensional Graphics".

Drawing grid lines in three dimensions.

The Wolfram Language allows you to draw grid lines on the faces of the box that surrounds a three-dimensional object. If you set (RefLink[FaceGrids, paclet:ref/FaceGrids])->(RefLink[All, paclet:ref/All]), grid lines are drawn in gray on every face. By setting (RefLink[FaceGrids, paclet:ref/FaceGrids])->{(Subscript[face, 1]),(Subscript[face, 2]),…} you can tell the Wolfram Language to draw grid lines only on specific faces. Each face is specified by a list {(Subscript[dir, x]),(Subscript[dir, y]),(Subscript[dir, z])}, where two of the (Subscript[dir, i]) must be 0, and the third one is +1 or -1. For each face, you can also explicitly tell the Wolfram Language where and how to draw the grid lines, using the same kind of specifications as you give for the (RefLink[GridLines, paclet:ref/GridLines]) option in two-dimensional graphics.

This draws grid lines only on the top and bottom faces of the box:

Show[PolyhedronData["Dodecahedron"],FaceGrids->{{0,0,1},{0,0,-1}}]