cla — Clear the contents of the current axes without clearing the whole figure.
cla clears the current axes only. This is useful when a figure contains multiple subplots and you want to clear one axes without disturbing the rest of the figure.
How cla works
cla()clears the active axes.- The current subplot selection determines which axes are cleared.
- Other axes in the same figure are left untouched.
claresets the line-style cycle for the cleared axes so subsequent plots start from the default style sequence again.
How RunMat runs cla on the GPU
cla performs no provider dispatch; it clears the active axes from the plotting registry and renderer state.
GPU memory and residency
cla only mutates plotting state and does not affect array residency.
Examples
Clear only the active subplot
subplot(1, 2, 1);
plot(1:5, 1:5);
subplot(1, 2, 2);
plot(1:5, [5 4 3 2 1]);
cla();Expected output:
% only the second subplot is clearedClear the current axes and plot again
plot(1:5, 1:5);
cla();
plot(1:5, [1 2 3 4 5]);Expected output:
% the second plot starts on an empty axesFAQ
How is cla different from clf?
cla clears only the current axes, while clf clears the entire current figure.
Does cla affect other subplots?
No. It clears only the active axes.
Does cla run on the GPU?
No. It only mutates host-side plotting state.
Related Plotting functions
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how cla works, line by line, in Rust.
- View cla.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.