daspect — Query or set axes data aspect ratio.

daspect controls the data aspect ratio for the current or specified axes. RunMat supports ratio query, positive three-element ratio assignment, mode query, auto/manual mode assignment, and the corresponding DataAspectRatio and DataAspectRatioMode axes properties.

Syntax

ratio = daspect()
ratio = daspect(ratio)
mode = daspect(mode)
ratio = daspect(ax)
ratio = daspect(ax, ratio_or_mode)

Inputs

NameTypeRequiredDefaultDescription
ratioNumericArrayYesThree-element positive numeric data aspect ratio.
modeStringScalarYesMode string: 'auto', 'manual', or 'mode'.
axAxesHandleYesTarget axes handle.
ratio_or_modeAnyYesRatio vector or mode string.

Returns

NameTypeDescription
ratioNumericArrayCurrent data aspect ratio [dx dy dz].
modeStringScalarCurrent data aspect ratio mode, 'auto' or 'manual'.

Errors

IdentifierWhenMessage
RunMat:daspect:InvalidArgumentArgument count, axes handle, ratio vector, or mode string is invalid.daspect: invalid argument
RunMat:daspect:InternalInternal plotting state update fails.daspect: internal operation failed

GPU memory and residency

daspect is axes metadata only. It does not gather, upload, or mutate numeric GPU buffers; rendering applies the stored aspect metadata through the normal plot camera/bounds path.

Examples

plot(0:10, sin(0:10));
daspect([1 2 1]);
get(gca, 'DataAspectRatio')

Expected output:

ans =
     1     2     1
ax = subplot(1,2,1);
plot(ax, 1:4, [1 4 9 16]);
daspect(ax, [1 1 1]);
daspect(ax, 'mode')

Expected output:

ans =
    'manual'

Using daspect with coding agents

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

Run a small daspect example, explain the result, then change one input and compare the output.

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how daspect is executed, line by line, in Rust.

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.