hgload — Load graphics object hierarchies from RunMat FIG files.

hgload(filename) loads top-level graphics objects from a RunMat FIG file. The two-output form returns previous property values for overridden top-level figure properties.

Syntax

h = hgload(filename)
[h, old_prop_values] = hgload(filename, property_structure)

Inputs

NameTypeRequiredDefaultDescription
argsAnyVariadicMATLAB-compatible figure persistence arguments.

Returns

NameTypeDescription
figNumericArrayFigure handle or array of figure handles.
hNumericArrayTop-level graphics handles loaded from the file.
old_prop_valuesAnyCell array of previous top-level property values overridden by hgload.

Returned values from hgload depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:figurePersistence:InvalidArgumentArguments are missing, malformed, or incompatible with the requested figure persistence operation.figure persistence: invalid argument
RunMat:figurePersistence:UnsupportedFormatThe requested save/load format is recognized but not supported by RunMat's active plotting exporter.figure persistence: unsupported format
RunMat:figurePersistence:IoFailureThe target file cannot be read, written, flushed, synced, or atomically replaced.figure persistence: file I/O failed

How hgload works

  • hgload(filename) appends .fig when the filename has no extension and returns a scalar handle or row vector of handles.
  • [h, old] = hgload(filename, property_structure) applies recognized top-level figure property overrides after import.
  • Unrecognized override fields are ignored and omitted from old, matching MATLAB's documented top-level override behavior.

Does RunMat run hgload on the GPU?

No numeric GPU kernel is launched.

Loaded figure content can render through the normal plotting renderer.

GPU memory and residency

hgload returns host graphics handles and optional host cell/struct metadata.

Example

Load and override figure name

plot(1:3);
hgsave(gcf, "named.fig");
[h, old] = hgload("named.fig", struct("Name", "Loaded"));

Using hgload with coding agents

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

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

Open-source implementation

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