yscale — Query or set the Y-axis scale for the current axes or a specified axes handle.

yscale controls whether the Y axis is displayed on a linear or logarithmic scale. It supports query, explicit scale assignment, command-form style string arguments, and explicit axes-target forms.

Syntax

scale = yscale()
yscale(scale)
yscale(ax, scale)

Inputs

NameTypeRequiredDefaultDescription
scaleStringScalarYesScale string: 'linear' or 'log'.
axAxesHandleYesTarget axes handle.

Returns

NameTypeDescription
scaleStringScalarCurrent Y-axis scale, 'linear' or 'log'.

Errors

IdentifierWhenMessage
RunMat:yscale:InvalidArgumentArgument count, scale value, or axes handle is invalid.yscale: invalid argument
RunMat:yscale:InternalInternal plotting state update fails.yscale: internal operation failed

GPU memory and residency

yscale reads and writes axes metadata. The renderer applies log mapping in its direct GPU coordinate path without gathering GPU-resident plot data.

Examples

Switch the Y axis to logarithmic scale

plot(1:100, (1:100).^2);
yscale('log');
yscale()

Expected output:

ans = 'log'

Apply scale to a specific subplot

ax = subplot(1, 2, 2);
plot(ax, 1:100, exp((1:100)/20));
yscale(ax, 'log');

Expected output:

% Only the target axes receives logarithmic Y scaling

Using yscale with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how yscale changes the result.

Run a small yscale 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.