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
| Name | Type | Description |
|---|---|---|
root | NumericScalar | Root graphics object handle. |
How groot works
groot()returns scalar numeric handle0.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 = 1Round-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.
Related Plotting functions
2D Charts
area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem
Other
addpoints · ancestor · animatedline · axes · barh · cla · clf · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill3 · findobj · fsurf · gobjects · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · textscatter · textscatter3 · triplot · waitbar · wordcloud · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zoom
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how groot is executed, line by line, in Rust.
- View the source for groot in Rust on GitHub
- Learn how the RunMat 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 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.