zlim — Query or set z-axis limits.
zlim([zmin zmax]) sets the z-axis limits, while zlim() returns the current limits as a double vector.
Syntax
limits = zlim()
limits = zlim([zmin zmax])
limits = zlim(mode)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
limits | NumericArray | Yes | — | Two-element numeric vector [zmin zmax]. |
mode | StringScalar | Yes | — | Limit mode string ('auto', 'tight', or 'manual'). |
Returns
| Name | Type | Description |
|---|---|---|
limits | NumericArray | Two-element vector [zmin zmax] or [NaN NaN] when auto. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:zlim:InvalidArgument | Argument count, mode, or limit vector is invalid. | zlim: invalid argument |
RunMat:zlim:Internal | Internal plotting state update fails. | zlim: internal operation failed |
How zlim works
- The two-element limits vector may use single, double, or any native integer class.
- Native integer endpoints are ordered using their exact values before conversion to graphics coordinates.
- Endpoints must be finite, increasing, and remain distinct in the graphics coordinate domain.
- The supported text modes are
'auto','tight', and'manual'.
Examples
Set integer limits
surf(peaks());
zlim(int16([-10 10]))Query current limits
limits = zlim()Using zlim with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how zlim changes the result.
Run a small zlim 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 · caxis · cla · clf · clim · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill · 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 · text · textscatter · textscatter3 · triplot · waitbar · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zoom
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how zlim is executed, line by line, in Rust.
- View the source for zlim 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.