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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ratio | NumericArray | Yes | — | Three-element positive numeric data aspect ratio. |
mode | StringScalar | Yes | — | Mode string: 'auto', 'manual', or 'mode'. |
ax | AxesHandle | Yes | — | Target axes handle. |
ratio_or_mode | Any | Yes | — | Ratio vector or mode string. |
Returns
| Name | Type | Description |
|---|---|---|
ratio | NumericArray | Current data aspect ratio [dx dy dz]. |
mode | StringScalar | Current data aspect ratio mode, 'auto' or 'manual'. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:daspect:InvalidArgument | Argument count, axes handle, ratio vector, or mode string is invalid. | daspect: invalid argument |
RunMat:daspect:Internal | Internal 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 1ax = 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.
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 · 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 · ytickformat · yticklabels · yticks · zoom
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how daspect is executed, line by line, in Rust.
- View the source for daspect in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
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.