groot — Return the root graphics object handle.

groot returns the MATLAB-compatible root graphics object handle, numeric handle 0. Root properties expose global plotting state such as the current figure, open figure children, screen metadata, units, and show-hidden-handles mode.

Syntax

root = groot()

Returns

NameTypeDescription
rootNumericScalarRoot graphics object handle.

How groot works

  • groot() returns scalar numeric handle 0.
  • get(groot, 'Type') returns 'root'.
  • get(groot, 'CurrentFigure') returns the current figure handle, or an empty handle array when no figure exists.
  • get(groot, 'Children') returns currently open figure handles in stable ascending order.
  • set(groot, 'CurrentFigure', fig) selects an existing figure as current.
  • set(groot, 'default...', value) stores arbitrary root default properties for compatibility with scripts that configure graphics defaults.

Does RunMat run groot on the GPU?

groot performs no provider dispatch; it reads or updates root plotting metadata in the runtime registry.

GPU memory and residency

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

Examples

Read root graphics properties

r = groot();
{get(r, 'Type'), isempty(get(r, 'CurrentFigure'))}

Expected output:

{'root', true}

Select a current figure through the root object

r = groot();
f1 = figure(1);
f2 = figure(2);
set(r, 'CurrentFigure', f1);
gcf()

Expected output:

ans = 1

Round-trip a root default graphics property

set(groot, 'defaultAxesTickLabelInterpreter', 'latex');
get(groot, 'defaultAxesTickLabelInterpreter')

Expected output:

ans = 'latex'

Using groot with coding agents

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

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

FAQ

Is groot the same value as MATLAB's root object?

Yes. RunMat uses numeric handle 0 for the root graphics object.

Does setting root defaults restyle all future graphics objects?

RunMat stores and returns common scalar, text, string-array, and numeric-array default... root properties for compatibility. Full automatic application of every MATLAB root default is handled incrementally as each graphics property area is implemented.

Does groot gather GPU arrays?

No. It only touches graphics metadata and global plotting state.

Open-source implementation

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