yticks
Set or get y-axis tick values.
📝Syntax
ticks = yticks()
yticks(values)
yticks('auto')
yticks('manual')
m = yticks('mode')
yticks(ax, ...)
📥Input Arguments
Parameter Description
values Numeric vector of y-axis tick values.
'auto' Enable automatic y-tick selection.
'manual' Freeze the current y-tick values.
'mode' Return the y-tick mode.
ax Target axes. Default is the current axes.
📤Output Arguments
Parameter Description
ticks Numeric row vector of y-axis tick values.
m 'auto' or 'manual'.
📄Description

yticks gets or sets the tick values along the y-axis of the current axes.

Specifying tick values switches the y-tick mode to manual.

💡Examples
Set y-axis ticks.
x = linspace(0, 10, 50);
plot(x, sin(x));
yticks(-1:0.5:1);
ticks = yticks()
🔗See Also
yticklabelsytickangleylim
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub