xtickformat(fmt)
fmt = xtickformat()
xtickformat(ax, ...)
| Parameter | Description |
|---|---|
| fmt | Format specifier: a sprintf-style conversion or a preset keyword. |
| ax | Target axes. Default is the current axes. |
| Parameter | Description |
|---|---|
| fmt | Current tick label format. |
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.
plot(1:10, (1:10) / 4);
xtickformat('%.2f');
| Version | Description |
|---|---|
| 2.0.0 | initial version |