This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / The Mathematica Book / Principles of Mathematica / The Structure of Graphics and Sound  /

2.9.13 Labeling Three-Dimensional Graphics

Mathematica provides various options for labeling three-dimensional graphics. Some of these options are directly analogous to those for two-dimensional graphics, discussed in Section 2.9.5. Others are different.


Some options for labeling three-dimensional graphics.

  • This loads a package containing various polyhedra.
  • In[1]:= <<Graphics`Polyhedra`

  • The default for Graphics3D is to include a box, but no other forms of labeling.
  • In[2]:= Show[Graphics3D[Dodecahedron[ ]]]











  • Setting Axes->True adds , and


    axes.
  • In[3]:= Show[%, Axes -> True]


  • This adds grid lines to each face of the box.
  • In[4]:= Show[%, FaceGrids -> All]



    Style options.

  • This makes the box dashed, and draws axes which are thicker than normal.
  • In[5]:= Show[Graphics3D[Dodecahedron[ ]],
    BoxStyle -> Dashing[{0.02, 0.02}],
    Axes -> True, AxesStyle -> Thickness[0.01]]


    By setting the option Axes->True, you tell Mathematica 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 AxesEdge allows you to specify on which edge to draw each of the axes.


    Specifying where to draw three-dimensional axes.
















  • This draws the on the edge with larger and coordinates, draws no axis, and chooses automatically where to draw the


    axis.
  • In[6]:= Show[Graphics3D[Dodecahedron[ ]], Axes -> True,
    AxesEdge -> {{1, 1}, None, Automatic}]



































    When you draw the 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 and coordinates. When you use the specification





    ,


    for where to draw the axis, you can set the to be +1 or -1 to represent larger or smaller values for the and


    coordinates.


    Axis labels in three-dimensional graphics.

  • You can use AxesLabel to label edges of the box, without necessarily drawing scales on them.
  • In[7]:= Show[Graphics3D[Dodecahedron[ ]], Axes -> True,
    AxesLabel -> {"x", "y", "z"}, Ticks -> None]



    Settings for the Ticks option.

    You can give the same kind of tick mark specifications in three dimensions as were described for two-dimensional graphics in Section 2.9.5.


    Drawing grid lines in three dimensions.































    Mathematica allows you to draw grid lines on the faces of the box that surrounds a three-dimensional object. If you set FaceGrids->All, grid lines are drawn in gray on every face. By setting FaceGrids->





    ,


    , ... you can tell Mathematica to draw grid lines only on specific faces. Each face is specified by a list





    ,


    ,


    , where two of the must be 0, and the third one is +1 or -1. For each face, you can also explicitly tell Mathematica where and how to draw the grid lines, using the same kind of specifications as you give for the GridLines


    option in two-dimensional graphics.

  • This draws grid lines only on the top and bottom faces of the box.
  • In[8]:= Show[Graphics3D[Dodecahedron[ ]],
    FaceGrids -> {{0, 0, 1}, {0, 0, -1}}]