box — Toggle axes box outlines for chart framing, presentation, and MATLAB box on / box off workflows.
box controls whether the current axes draw their outer frame. Like MATLAB, RunMat supports box on, box off, and bare box toggling. This is mainly a presentation/state command, so it is usually used alongside axis, grid, and subplot-specific styling.
How box works in RunMat
box onenables the axes frame on the current axes.box offdisables the axes frame on the current axes.- Calling
boxwith 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;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.
Related functions to explore
These functions work well alongside box. Each page has runnable examples you can try in the browser.
More plotting resources
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how box works, line by line, in Rust.
- View box.rs on GitHub
- Learn how the 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 — 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.