RunMat
GitHub

zlabel — Set z-axis labels for 3-D plots, surfaces, and MATLAB zlabel workflows.

zlabel sets or updates the z-axis label for the current axes or an explicit axes handle. In RunMat it returns a text handle, stores the label as subplot-local axes metadata, and supports the same multiline/property workflows as the other shared text builtins used for titles and axis labels.

How zlabel works in RunMat

  • The returned value is a text handle that can be queried and updated through get and set.
  • String scalars, string arrays, and cell arrays can all be used to build multiline z-axis labels in MATLAB-style workflows.
  • Font and text styling properties flow through the shared plotting text-property system, so get and set work on the returned handle.
  • Z-axis labels are subplot-local and stay attached to the axes they were created for.

Examples

Add a z-axis label to a surface plot

[X, Y] = meshgrid(linspace(-3, 3, 50), linspace(-3, 3, 50));
Z = sin(X) .* cos(Y);
surf(X, Y, Z);
zlabel('Height');

Create a multiline z-axis label and style it

[X, Y] = meshgrid(-2:0.2:2, -2:0.2:2);
Z = X .* exp(-X.^2 - Y.^2);
surf(X, Y, Z);
h = zlabel(["Depth", "(km)"]);
set(h, 'FontWeight', 'bold');

Target a specific subplot axes

[X, Y] = meshgrid(linspace(-3, 3, 30), linspace(-3, 3, 30));
Z = sin(X) .* cos(Y);
subplot(1, 2, 1);
surf(X, Y, Z);
ax = subplot(1, 2, 2);
plot3(cos(0:0.1:5), sin(0:0.1:5), 0:0.1:5);
zlabel(ax, 'Trajectory Height');

These functions work well alongside zlabel. Each page has runnable examples you can try in the browser.

view, plot3, surf, get, set

Open-source implementation

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

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.

  • Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
  • Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
  • A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.

Getting started · Benchmarks · Pricing

Try RunMat — free, no sign-up

Start running MATLAB code immediately in your browser.