Set or query y-axis tick labels
yticklabels(
sets the
y-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 y-axis tick values and tick labels no
longer update automatically based on changes to the axes.
returns
the y-axis tick labels for the current axes.yl
= yticklabels
yticklabels('auto')
sets an automatic mode,
enabling the axes to determine the y-axis tick
labels. Use this option if you set the labels and then want to set
them back to the default values.
yticklabels('manual')
sets a manual mode,
freezing the y-axis tick labels at the current
values.
returns
the current value of the y-axis tick labels mode,
which is either m
= yticklabels('mode')'auto'
or 'manual'
.
By default, the mode is automatic unless you specify the tick labels
or set the mode to manual.
The yticklabels
function sets and queries
several axes properties related to the y-axis
tick labels.
YTickLabel
— Property that stores the text for the y-axis
tick labels.
YTickLabelMode
— Property that stores the y-axis tick label
mode. When you set the y-axis tick labels using
yticklabels
, this property changes to
'manual'
.
YTickMode
—
Property that stores the y-axis tick value mode. When
you set the y-axis tick labels using
yticklabels
, this property changes to
'manual'
.