xtickformat
Set or get the x-axis tick label format.
📝Syntax
xtickformat(fmt)
fmt = xtickformat()
xtickformat(ax, ...)
📥Input Arguments
Parameter Description
fmt Format specifier: a sprintf-style conversion or a preset keyword.
ax Target axes. Default is the current axes.
📤Output Arguments
Parameter Description
fmt Current tick label format.
📄Description

xtickformat sets or gets the format used for the x-axis tick labels of the current axes.

The format applies to automatically generated tick labels.

The format is a sprintf-style conversion (for example %.2f or %g) applied to each numeric tick value. The preset keywords usd, eur, gbp, jpy, degrees and percentage are also accepted. Custom tick labels set with xticklabels take precedence over the format.

💡Examples
Format x-axis tick labels.
plot(1:10, (1:10) / 4);
xtickformat('%.2f');
🔗See Also
xticksxticklabelsytickformat
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub