zlabel

Sets the label of the z-axis of a 3-D plot.

Category: Graphics > Formatting and Annotation

Syntax

zlabel(txt)

Labels the z-axis of the current axes with txt.

zlabel(txt, Name, Value)

Also sets text properties such as 'FontSize'.

t = zlabel(___)

Returns the text object of the label.

Description

zlabel is the z counterpart of xlabel and ylabel. The label belongs to the axes, so it survives later plot calls on the same axes unless the axes are reset.

Input arguments

txt
Character vector, string or cell array of lines.

Output arguments

t
Handle of the label text object.

Example

Label a surface

surf(peaks(10))
h = zlabel('Height', 'FontSize', 14);
disp(h.String)
Output
Height

See also

xlabel ylabel zlim title surf