yticks — Query or set Y-axis tick values.
yticks returns or updates the tick mark locations for the Y axis of the current or specified axes.
Syntax
ticks = yticks()
ticks = yticks(ticks)
mode = yticks(mode)
ticks = yticks(ax, ticks)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ticks | NumericArray | Yes | — | Increasing numeric vector of Y-axis tick values; [] removes tick marks. |
mode | StringScalar | Yes | — | Tick mode string: 'auto', 'manual', or 'mode'. |
ax | AxesHandle | Yes | — | Target axes handle. |
ticks | NumericArray | Yes | — | Increasing numeric vector of Y-axis tick values. |
Returns
| Name | Type | Description |
|---|---|---|
ticks | NumericArray | Current Y-axis tick values. |
mode | StringScalar | Current Y-axis tick mode, 'auto' or 'manual'. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:yticks:InvalidArgument | Argument count, tick vector, mode, or axes handle is invalid. | yticks: invalid argument |
RunMat:yticks:Internal | Internal plotting state update fails. | yticks: internal operation failed |
How yticks works
yticks()returns the current Y-axis tick values as a row vector.yticks(ticks)sets manual Y-axis tick values.ticksmust be an increasing numeric vector;[]removes Y-axis tick marks.yticks('auto')returns the Y tick mode to automatic tick generation.yticks('manual')freezes the current tick values.yticks('mode')returns'auto'or'manual'.yticks(ax, ...)applies the same forms to the specified axes handle.get(ax, 'YTick'),set(ax, 'YTick', ticks),get(ax, 'YTickMode'), andset(ax, 'YTickMode', mode)share the same axes metadata.
GPU memory and residency
yticks only reads and writes axes metadata. It does not gather GPU-resident plot data; automatic ticks are generated from the axes display bounds, including explicit limits and cached plotted-data bounds.
Examples
Set nonuniform Y-axis ticks
plot(-5:5, (-5:5).^2);
yticks([0 2 4 9 16 25]);Expected output:
% Shows tick marks at the requested Y coordinatesRemove Y-axis tick marks
plot(1:10);
yticks([]);Expected output:
% Hides Y-axis tick marksUsing yticks with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how yticks changes the result.
Run a small yticks example, explain the result, then change one input and compare the output.
Related Plotting functions
2D Charts
area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem
Other
addpoints · ancestor · animatedline · axes · barh · cla · clf · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · textscatter · textscatter3 · triplot · waitbar · wordcloud · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · yline · yscale · ytickangle · ytickformat · yticklabels · zoom
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.