xticklabels
Set or get x-axis tick labels.
📝Syntax
labels = xticklabels()
xticklabels(labels)
xticklabels('auto')
xticklabels('manual')
m = xticklabels('mode')
xticklabels(ax, ...)
📥Input Arguments
Parameter Description
labels Cell array of character vectors or string array of x-axis tick labels.
'auto' Enable automatic x-tick labels.
'manual' Freeze the current x-tick labels.
'mode' Return the x-tick label mode.
ax Target axes. Default is the current axes.
📤Output Arguments
Parameter Description
labels Cell array of character vectors of x-axis tick labels.
m 'auto' or 'manual'.
📄Description

xticklabels gets or sets the tick labels along the x-axis of the current axes.

Specifying labels switches the x-tick label mode to manual.

💡Examples
Set x-axis tick labels.
bar([10 20 30 41]);
xticks(1:4);
xticklabels({'A','B','C','D'});
labels = xticklabels()
🔗See Also
xticksxtickangleyticklabels
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub