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
"Labeling Two-Dimensional Graphics". Others are different.
Some options for labeling three-dimensional graphics.
The default for Graphics3D is to include a box, but no other forms of labeling.
| Out[1]= |  |
|
Setting Axes->True adds x, y and z axes.
| Out[2]= |  |
|
This adds grid lines to each face of the box.
| Out[3]= |  |
|
| BoxStyle->style | specify the style for the box |
| AxesStyle->style | specify the style for the axes |
| AxesStyle->{xstyle,ystyle,zstyle} | specify separate styles for each axis |
Style options.
This makes the box dashed, and draws axes which are thicker than normal.
| Out[4]= |  |
|
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.
| AxesEdge->Automatic | use an internal algorithm to choose where to draw all axes |
| AxesEdge->{xspec,yspec,zspec} | give separate specifications for each of the x, y and z axes |
| None | do not draw this axis |
| Automatic | decide automatically where to draw this axis |
| {diri,dirj} | specify on which of the four possible edges to draw this axis |
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.
| Out[5]= |  |
|
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
{diry, dirz} for where to draw the
x axis, you can set the
diri 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 AxesLabel to label edges of the box, without necessarily drawing scales on them.
| Out[6]= |  |
|
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
"Labeling Two-Dimensional Graphics".
| FaceGrids->None | draw no grid lines on faces |
| FaceGrids->All | draw grid lines on all faces |
| FaceGrids->{face1,face2,...} | draw grid lines on the faces specified by the facei |
| FaceGrids->{{face1,{xgrid1,ygrid1}},...} | use xgridi, ygridi to determine where and how to draw grid lines on each face |
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->{face1, face2, ...} you can tell
Mathematica to draw grid lines only on specific faces. Each face is specified by a list
{dirx, diry, dirz}, where two of the
diri 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.
| Out[7]= |  |
|