ytickformat — Query or set the Y-axis tick label format for the current axes, a specified axes handle, or an axes array.
ytickformat controls automatic Y-axis tick label formatting. It supports query, numeric format assignment, MATLAB shorthand formats such as usd and percentage, custom printf-style numeric formats, date/duration format strings for compatibility, scalar axes query forms, and axes-array setter forms.
Syntax
fmt = ytickformat()
ytickformat(fmt)
fmt = ytickformat(ax)
ytickformat(ax, fmt)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
fmt | StringScalar | Yes | — | Numeric, date, or duration tick label format. |
ax | AxesHandle | Yes | — | Target axes handle or array of axes handles. |
Returns
| Name | Type | Description |
|---|---|---|
fmt | StringScalar | Current Y-axis tick label format. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:ytickformat:InvalidArgument | Argument count, format value, or axes handle is invalid. | ytickformat: invalid argument |
RunMat:ytickformat:Internal | Internal plotting state update fails. | ytickformat: internal operation failed |
GPU memory and residency
ytickformat only reads and writes axes metadata. It does not inspect, gather, or transform GPU-resident plot data; formatted labels are generated from tick metadata at render/query time.
Examples
Show Y-axis tick labels as percentages
plot(1:3, [0 0.5 1]);
yticks([0 0.5 1]);
ytickformat('percentage');
yticklabels()Expected output:
{'0%', '0.5%', '1%'}Apply a format to a specific subplot
ax1 = subplot(1, 2, 1);
plot(ax1, 1:3);
ax2 = subplot(1, 2, 2);
plot(ax2, 10:10:30);
ytickformat(ax2, '$%,.2f');Expected output:
% Only ax2 receives the dollar tick-label formatUsing ytickformat with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how ytickformat changes the result.
Run a small ytickformat 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 · yticklabels · yticks · 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.