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

NameTypeRequiredDefaultDescription
fmtStringScalarYesNumeric, date, or duration tick label format.
axAxesHandleYesTarget axes handle or array of axes handles.

Returns

NameTypeDescription
fmtStringScalarCurrent Y-axis tick label format.

Errors

IdentifierWhenMessage
RunMat:ytickformat:InvalidArgumentArgument count, format value, or axes handle is invalid.ytickformat: invalid argument
RunMat:ytickformat:InternalInternal 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 format

Using 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.

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.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.