ztickformat

Sets the numeric format of the z tick labels.

Category: Graphics > Formatting and Annotation

Syntax

ztickformat(fmt)

Formats the z tick labels with fmt, for example '%.1f'.

f = ztickformat

Returns the current format.

Description

The format controls how tick values are converted to text, so it can fix the number of decimals or add a unit, as in '%g m'. It is the z version of xtickformat and ytickformat.

Input arguments

fmt
A sprintf-style format such as '%d' or '%.2f'; for datetime or duration axes, a date or duration format.

Output arguments

f
Current format text.

Example

One decimal on z ticks

surf(peaks(10))
ztickformat('%.1f')

Notes

In MatLivre ztickformat stores the format and returns it, but the z tick labels do not use it yet.

See also

xtickformat ytickformat zticks zticklabels