RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.2, Nov 26, 2026 ·

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • addpoints
    • ancestor
    • animatedline
    • area
    • autumn
    • axes
    • axis
    • bar
    • barh
    • bone
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • cool
    • copper
    • copyobj
    • cylinder
    • daspect
    • datacursormode
    • dataTipTextRow
    • drawnow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • gray
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • hot
    • image
    • imagesc
    • imshow
    • inferno
    • isgraphics
    • ishandle
    • jet
    • legend
    • line
    • lines
    • linkaxes
    • loglog
    • magma
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • pink
    • plasma
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • spring
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • summer
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • turbo
    • view
    • viridis
    • waitbar
    • winter
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

figure — Create or select RunMat plotting figures.

figure creates a new plotting figure or selects an existing one as current. RunMat currently encodes graphics handles as host f64 identifiers instead of MATLAB Figure objects; this is a general graphics-representation gap, not numeric MATLAB equivalence. Double numeric selection is the compatibility form, while typed-integer targets, single-precision targets, the 'next' selector, and typed-integer property values are independently gated RunMat-only extensions.

Syntax

fig = figure()
fig = figure(h)
fig = figure(property, value, ...)
fig = figure(h, property, value, ...)

Inputs

h
Type
NumericScalar
Required
Yes
Description
RunMat numeric figure identifier.
properties
Type
PropertyName
Required
Variadic
Description
Figure property/value pairs such as 'Name', 'NumberTitle', 'Visible', 'Position', or 'Color'.
properties
Type
PropertyName
Required
Variadic
Description
Figure property/value pairs to apply after selecting or creating the figure.
NameTypeRequiredDefaultDescription
hNumericScalarYes—RunMat numeric figure identifier.
propertiesPropertyNameVariadic—Figure property/value pairs such as 'Name', 'NumberTitle', 'Visible', 'Position', or 'Color'.
propertiesPropertyNameVariadic—Figure property/value pairs to apply after selecting or creating the figure.

Returns

fig
Type
NumericScalar
Description
RunMat f64 graphics-handle encoding (not a MATLAB Figure object).
NameTypeDescription
figNumericScalarRunMat f64 graphics-handle encoding (not a MATLAB Figure object).

Errors

RunMat:figure:InvalidArgument
When
Provided figure handle argument is invalid.
Message
figure: invalid argument
RunMat:figure:TooManyOutputs
When
More than 1 output arguments are requested.
Message
figure: too many output arguments
IdentifierWhenMessage
RunMat:figure:InvalidArgumentProvided figure handle argument is invalid.figure: invalid argument
RunMat:figure:TooManyOutputsMore than 1 output arguments are requested.figure: too many output arguments

Behavior

figure() creates a new figure and returns RunMat's current host f64 graphics-handle encoding.

figure(n) selects figure n. If that handle does not exist yet, RunMat creates it.

In RunMat extension mode, figure('next') creates a new figure instead of selecting an existing one.

In RunMat extension mode, a positive scalar from any of the eight integer classes is read exactly as a figure identifier and must fit in u32.

In RunMat extension mode, a positive single-precision scalar can select a figure. Logical and GPU-resident numeric targets reject without provider access.

Typed-integer values for Position, Color, NumberTitle, Visible, CurrentAxes, and SgTitle are RunMat-only extensions and are rejected in compatibility mode before graphics state changes.

Integer Position values cross an explicit host f64 geometry boundary only after every authoritative integer element is proved exactly representable. Integer RGB values are read authoritatively and the normal [0,1] constraint admits only exact zero and one components.

Integer NumberTitle and Visible values use an exact zero/nonzero predicate with no floating conversion. Integer CurrentAxes and SgTitle aliases must be exactly representable before lookup in RunMat's current f64 graphics registry.

figure('Property', value, ...) creates a fresh figure and applies the requested figure properties.

figure(n, 'Property', value, ...) selects or creates figure n and applies the requested figure properties.

figure('Position', [left bottom width height]) stores MATLAB-style figure window geometry and makes it available through get(f, 'Position') and figure scene metadata.

The selected figure becomes the target for subsequent plotting commands such as plot, subplot, gca, clf, and hold.

Options

'Name' sets the figure window name and can be inspected later with get(f, 'Name').

'NumberTitle' accepts logical values or MATLAB-style 'on'/'off' strings.

'Visible' accepts logical values or MATLAB-style 'on'/'off' strings. Hidden figures keep their graphics state but do not open or update interactive windows until made visible again.

'Position' accepts a finite four-element numeric vector [left bottom width height]; width and height must be positive.

'Color' accepts supported color letters, full color names such as 'black', or RGB triples, and updates the figure background color.

Placement and residency

figure manages plotting state and handles. It does not execute numeric GPU kernels.

figure only updates plotting state and returns RunMat's host-side f64 handle encoding. Resident numeric values are not admitted as figure targets and are not gathered.

figure performs no provider dispatch. GPU-resident arrays passed to later plotting calls may still remain on device when the renderer supports that path.

Execution, authority, and current limits

The canonical binding uses the same runtime implementation in interpreter and compiled execution. Requested output arity is checked before this operation can mutate graphics state or gather coordinate data; discarding an output does not suppress the operation.

Graphics handles encode local registry identities, not transferable figure, axes, or chart state. Copying a numeric handle to a worker, foreign runtime, or serialized value does not transfer its graphics authority. This host operation is a fusion boundary; no numeric GPU kernel or distributed implementation is supplied.

Finite Managed allocation remains an L25 obligation: complete scratch, metadata, retained graphics-state, and output ownership are not yet quoted by these implementations. The shared graphics admission owner refuses Managed policy before unowned work, captures cancellation authority, and checks it before publication; that safety fence is not finite-allocation completion. Unbounded host scratch may still contain synchronous loops.

Examples

Create a fresh figure

f = figure()

Selecting the next available figure

f1 = figure();
f2 = figure("next")

Select a specific figure handle

figure(3);
plot(1:5, [1 4 2 5 3]);

Create a named figure with MATLAB-style property pairs

f = figure('Name', 'demo', 'NumberTitle', 'off', 'Visible', 'off');
plot(1:5, [1 4 2 5 3]);

Create a figure with explicit geometry

f = figure('Position', [100 100 1000 700]);
pos = get(f, 'Position')

Using figure with coding agents

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

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

FAQ

Does figure(n) require the handle to exist already?⌄

No. RunMat selects figure n, creating it on demand if necessary.

What does figure('next') do?⌄

In RunMat extension mode it forces creation of a new figure rather than reusing an existing handle. Compatibility mode rejects this selector before changing graphics state.

Can figure set window properties at creation time?⌄

Yes. Pass alternating property/value pairs, either directly or after a numeric handle: figure('Name', 'demo') or figure(3, 'Name', 'demo', 'NumberTitle', 'off').

Does figure draw anything by itself?⌄

No. It only manages the active figure selection. Plotting happens when you call builtins like plot, scatter, or surf.

Why is the returned handle a double scalar?⌄

RunMat's current graphics registry uses a host f64 identifier. MATLAB uses Figure objects, so this representation is tracked as a general graphics-model gap rather than claimed as numeric compatibility.

Can integer, single, logical, or GPU-resident values select a figure?⌄

Host scalar integers and singles are independent RunMat-only extensions. Integers are read from authoritative storage and must be positive u32 values. Logical and resident numeric targets reject.

Can figure property values use typed integers?⌄

Only in RunMat extension mode. Position and graphics-object aliases reject integer values that would round at an f64 boundary, Color accepts only the usual zero/one integer RGB components, and NumberTitle/Visible use exact zero/nonzero tests. These gates run before figure creation, selection, or property mutation.

Related Plotting functions

2D Charts

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

3D & Surface

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

Images

image · imagesc · imshow

Axes & Layout

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

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

addpoints · ancestor · animatedline · autumn · axes · barh · bone · caxis · cla · clf · clim · colorcube · colororder · cool · copper · copyobj · cylinder · daspect · datacursormode · dataTipTextRow · drawnow · fcontour · fill · fill3 · findobj · fsurf · gobjects · gray · groot · hgload · hgsave · hidden · histogram2 · hold · hot · inferno · isgraphics · ishandle · jet · line · lines · linkaxes · magma · openfig · opengl · pan · parula · patch · pink · plasma · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · spring · stackedplot · subtitle · summer · suptitle · text · textscatter · textscatter3 · triplot · turbo · viridis · waitbar · winter · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom

More plotting resources

  • Styling plots and axes
  • Plot replay and export
  • Complete plotting guide

Source you can read

Every RunMat function's source is public. Read exactly how figure is executed, line by line, in Rust.

  • View the source for figure in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/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.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Behavior
  • Options
  • Placement and residency
  • Execution, authority, and current limits
  • Examples
  • Create a fresh figure
  • Selecting the next available figure
  • Select a specific figure handle
  • Create a named figure with MATLAB-style property pairs
  • Create a figure with explicit geometry
  • Using figure with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • More plotting resources
  • Source you can read
  • About RunMat