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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
scale | StringScalar | Yes | — | Scale string: 'linear' or 'log'. |
ax | AxesHandle | Yes | — | Target axes handle. |
Returns
| Name | Type | Description |
|---|---|---|
scale | StringScalar | Current Y-axis scale, 'linear' or 'log'. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:yscale:InvalidArgument | Argument count, scale value, or axes handle is invalid. | yscale: invalid argument |
RunMat:yscale:Internal | Internal 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 scalingUsing 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.
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 · ytickangle · ytickformat · 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.