RunMat
GitHub

gcf — Return the numeric handle of the current figure.

gcf returns the numeric handle of the figure that is currently selected for plotting operations.

How gcf works

  • gcf() returns a scalar numeric figure handle.
  • The value changes after commands like figure(n) or figure('next') select a different figure.
  • Subsequent plotting commands target the same current figure until another figure is selected.

How RunMat runs gcf on the GPU

gcf performs no provider dispatch; it simply reads the current figure handle from plotting state.

GPU memory and residency

gcf returns a host-side numeric handle and does not interact with GPU residency.

Examples

Read the current figure handle

figure(2);
f = gcf()

Expected output:

f = 2

Observe the handle change after selecting a different figure

figure(1);
f1 = gcf();
figure(4);
f2 = gcf();

Expected output:

f1 = 1
f2 = 4

FAQ

What type of value does gcf return?

It returns a scalar double representing the current figure handle.

Does gcf create a plot?

No. It only reports which figure is currently selected.

Does gcf run on the GPU?

No. It only reads 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

cla · clf · figure · gca · hold · imshow · title

Open-source implementation

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