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.1, Nov 17, 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

drawnow — Present pending figure updates and process graphics callbacks.

drawnow asks the selected graphics host to present pending figure updates and process callbacks. Its control forms can rate-limit presentation or defer callbacks without discarding them.

Syntax

drawnow
drawnow control
drawnow limitrate nocallbacks
ok = drawnow
ok = drawnow control
ok = drawnow limitrate nocallbacks

Inputs

control
Type
StringScalar
Required
Yes
Default
—
Description
limitrate, nocallbacks, update, or expose.
limitrate
Type
StringScalar
Required
Yes
Default
—
Description
Limit presentation to at most 20 updates per second.
nocallbacks
Type
StringScalar
Required
Yes
Default
—
Description
Defer pending callbacks until a later full flush.
NameTypeRequiredDefaultDescription
controlStringScalarYes—limitrate, nocallbacks, update, or expose.
limitrateStringScalarYes—Limit presentation to at most 20 updates per second.
nocallbacksStringScalarYes—Defer pending callbacks until a later full flush.

Returns

ok
Type
LogicalArray
Description
RunMat-only status for a completed host flush.
NameTypeDescription
okLogicalArrayRunMat-only status for a completed host flush.

Errors

RunMat:drawnow:InvalidControl
When
A control token is unknown, duplicated, conflicting, or in an unsupported order.
Message
drawnow: invalid control
RunMat:drawnow:TooManyOutputs
When
More than one output is requested.
Message
drawnow: too many output arguments
RunMat:drawnow:PresentationFailed
When
The selected host fails to present a figure or process callbacks.
Message
drawnow: graphics presentation failed
—
When
Operand materialization or runtime control flow fails with its original cause.
Message
drawnow: internal error
IdentifierWhenMessage
RunMat:drawnow:InvalidControlA control token is unknown, duplicated, conflicting, or in an unsupported order.drawnow: invalid control
RunMat:drawnow:TooManyOutputsMore than one output is requested.drawnow: too many output arguments
RunMat:drawnow:PresentationFailedThe selected host fails to present a figure or process callbacks.drawnow: graphics presentation failed
—Operand materialization or runtime control flow fails with its original cause.drawnow: internal error

Forms

drawnow requests an immediate presentation and processes queued graphics callbacks. It does not create a figure when none exists; callback processing is a separate host obligation even in that case.

drawnow limitrate skips presentation when the renderer is busy or fewer than 50 ms have elapsed since its last presentation, but still processes callbacks. drawnow nocallbacks presents without processing callbacks; those callbacks remain queued for a later full flush. The two controls can be combined as drawnow limitrate nocallbacks.

Legacy drawnow update skips presentation only while busy and defers callbacks; it is not a 50 ms limit-rate request. Legacy drawnow expose presents immediately and defers callbacks. Both forms remain supported but are not recommended for new code.

Host and output behavior

The active native, browser, or Desktop presentation service owns the window/canvas receipt and callback queue. A numeric figure handle alone does not grant host or session authority. A host without a graphics presentation service fails with a typed capability error rather than reporting a successful no-op.

MATLAB-compatible calls are statements with no output. Requesting a logical completion status is a RunMat-only extension. A rate-limited call may complete without presenting a new frame; its status reports host completion, not proof of new pixels.

The call can suspend. Cancellation before dispatch has no host effect; once a host request may have committed, a lost acknowledgement is indeterminate rather than falsely reported as unpublished.

Examples

Present a changed plot

x = 0:0.1:1;
plot(x,x.^2);
drawnow;

Limit presentation while updating an animated line

h = animatedline;
for k = 1:10
    addpoints(h,k,sin(k));
    drawnow limitrate;
end
drawnow;

Using drawnow with coding agents

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

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

FAQ

Does drawnow create a figure?⌄

No. It can still process queued callbacks when there is no figure to present.

Does limitrate discard callbacks?⌄

No. It can defer a frame, but callbacks are processed unless nocallbacks is also requested.

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 · fcontour · figure · 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

  • Graphics host integration

Source you can read

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

  • View the source for drawnow 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
  • Forms
  • Host and output behavior
  • Examples
  • Present a changed plot
  • Limit presentation while updating an animated line
  • Using drawnow 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