Set or query x-axis tick labels
xticklabels(
sets the
x-axis tick labels for the
current axes. Specify labels
)labels
as a string array or a cell
array of character vectors; for example,
{'January','February','March'}
. If you specify the
labels, then the x-axis tick values and tick labels no
longer update automatically based on changes to the axes.
returns
the x-axis tick labels for the current axes.xl
= xticklabels
xticklabels('auto')
sets an automatic mode,
enabling the axes to determine the x-axis tick
labels. Use this option if you set the labels and then want to set
them back to the default values.
xticklabels('manual')
sets a manual mode,
freezing the x-axis tick labels at the current
values.
returns
the current value of the x-axis tick labels mode,
which is either m
= xticklabels('mode')'auto'
or 'manual'
.
By default, the mode is automatic unless you specify the tick labels
or set the mode to manual.
The xticklabels
function sets and queries
several axes properties related to the x-axis
tick labels.
XTickLabel
— Property that stores
the text for the x-axis tick labels.
XTickLabelMode
— Property that
stores the x-axis tick label mode. When you set
the x-axis tick labels using xticklabels
,
this property changes to 'manual'
.
XTickMode
— Property that stores
the x-axis tick value mode. When you set the x-axis
tick labels using xticklabels
, this property changes
to 'manual'
.