RunMat
GitHub

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.
  • cla resets 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 cleared

Clear 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 axes

FAQ

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.

2D Charts

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

3D & Surface

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

Images

image · imagesc

Axes & Layout

axis · box · grid · sgtitle · subplot · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

get · set

Other

clf · figure · gca · gcf · hold · imshow · title

Open-source implementation

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

Open the sandbox and start running MATLAB code in seconds. No account required.