A Word About Annotating 3-D Plots (Plotting in Three Dimensions) (MATLAB)

The approach you take to adding text to 3-dimensional plots is very similar to doing so for 2-dimensional plots.The only real difference is that you now have a z-axis that you can label. You have already seen this in action in this topic such as with the example of Figure 4.26 where we used the function zlabel.

In addition to the function zlabel, the function text can be specified with x-, y-, and z-coordinates, allowing you to place text anywhere in the 3-D space. The example of Figure 4.27 demonstrates the use of specifying a z-coordinate with text. Bear in mind, that placing text with either text or gtext simply puts the text where you specify; if you change the plot by re-plotting or changing the axis, the text will not likely be where you want it. As far as labeling axes, use x-, y-, or zlabel.

Next post:

Previous post: