RunMat
GitHub

box — Toggle axes box outlines in MATLAB and RunMat plotting.

box controls whether the current axes draw their outer frame. It supports box on, box off, and toggle form with no argument, matching MATLAB and RunMat plotting command behavior.

Syntax

enabled = box()
enabled = box(mode)

Inputs

NameTypeRequiredDefaultDescription
modeStringScalarNo"toggle"Box mode token ('on'|'off').

Returns

NameTypeDescription
enabledLogicalArrayBox outline enabled state after command execution.

Errors

IdentifierWhenMessage
RunMat:box:InvalidArgumentBox mode argument is unsupported.box: invalid argument

How box works

  • box on enables the axes frame on the current axes.
  • box off disables the axes frame on the current axes.
  • Calling box with no argument toggles the current state.
  • Box state is subplot-local and applies to the currently active axes.

Examples

Turn the axes frame on for a chart

plot(1:5, [1 4 2 5 3]);
box on;

Style subplots independently

subplot(1, 2, 1);
plot(1:5, 1:5);
box off;
subplot(1, 2, 2);
plot(1:5, [5 4 3 2 1]);
box on;

Using box with coding agents

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

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

FAQ

When should I turn the box off?

Turn box off for a cleaner, more modern chart style — especially for presentations or publications where the top and right frame edges add visual noise without carrying data. Many style guides prefer open axes (left + bottom only) for scatter plots and line charts.

Does box interact with grid or axis settings?

box, grid, and axis are independent axes-state commands. Turning box off removes the outer frame but doesn't touch grid lines or axis limits. You can combine them freely: box off; grid on; axis tight; is a common clean-chart recipe.

2D Charts

area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contour3 · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc · imshow

Axes & Layout

axis · grid · sgtitle · subplot · title · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

cla · clf · figure · fill3 · hold · patch · polarplot · print · suptitle · xline · yline

More plotting resources

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how box 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.