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

print — Export a figure to a PNG file.

print writes the active or selected figure as a PNG through the current filesystem provider. It supports MATLAB-style filename, -dpng, and resolution options. Other printer and vector-image devices are not available in this exporter.

Syntax

print(filename)
print(filename, '-dpng', '-rN')
print(fig, filename, ___)
ok = print(filename, ___)

Inputs

filename
Type
StringScalar
Required
Yes
Description
PNG destination; .png is appended when absent.
options
Type
Any
Required
Variadic
Description
Optional -dpng and -rN tokens in either order with the filename.
fig
Type
Any
Required
Yes
Description
Figure handle or RunMat-only typed-integer handle alias.
options
Type
Any
Required
Variadic
Description
Optional -dpng and -rN tokens.
NameTypeRequiredDefaultDescription
filenameStringScalarYes—PNG destination; .png is appended when absent.
optionsAnyVariadic—Optional -dpng and -rN tokens in either order with the filename.
figAnyYes—Figure handle or RunMat-only typed-integer handle alias.
optionsAnyVariadic—Optional -dpng and -rN tokens.

Returns

ok
Type
LogicalArray
Description
RunMat-only logical completion status.
NameTypeDescription
okLogicalArrayRunMat-only logical completion status.

Errors

RunMat:print:InvalidInput
When
The filename, figure handle, or argument ordering is invalid.
Message
print: invalid input arguments
RunMat:print:UnsupportedDevice
When
The requested device is not supplied by the active exporter.
Message
print: unsupported output device
RunMat:print:InvalidOption
When
An option token or resolution is invalid, a device is duplicated, or PNG dimensions exceed supported limits. Repeated resolution tokens use the last value.
Message
print: invalid option
IdentifierWhenMessage
RunMat:print:InvalidInputThe filename, figure handle, or argument ordering is invalid.print: invalid input arguments
RunMat:print:UnsupportedDeviceThe requested device is not supplied by the active exporter.print: unsupported output device
RunMat:print:InvalidOptionAn option token or resolution is invalid, a device is duplicated, or PNG dimensions exceed supported limits. Repeated resolution tokens use the last value.print: invalid option
RunMat:print:RenderFailedFigure capture or PNG rendering fails.print: figure export failed
RunMat:print:IoFailureCaptured filesystem authority, staging, writing, or publication fails.print: file I/O failed
—An underlying materialization or runtime control-flow operation fails with its original cause.print: internal error
RunMat:print:TooManyOutputsMore than one output is requested.print: too many output arguments

Forms and options

print(filename) and print(filename,'-dpng') export the current figure. print(fig,filename,'-dpng') chooses a figure explicitly. Device and filename text can occur in command-style order, including print -dpng command_style_plot.png.

-rN changes the output dimensions relative to the default 800-by-600 canvas at 150 DPI; -r0 selects that default. If repeated, the last resolution token wins. PNG is the only available device. Recognized PDF, EPS, and SVG requests fail with an unsupported-device error rather than producing PNG under another extension.

A filename without .png receives that extension. A requested logical success output is a RunMat extension; MATLAB-compatible file-export forms are statement calls. Typed-integer figure aliases are also RunMat-only and must exactly identify a graphics handle.

Storage and execution

The output is written through the selected filesystem authority. Native hosts can export to ordinary paths; browser hosts write to their installed virtual filesystem, from which the host can expose a download artifact. Export does not change figure data or the current directory.

Filename and option operands can materialize on the host. Plot data retained by the scene may be rendered through the shared WGPU path and fall back to CPU rasterization when headless GPU initialization is unavailable. print itself is an I/O and fusion boundary, not a numeric GPU kernel; it does not change plot-data residency.

A host-known figure is copied before operand materialization. A resident numeric figure handle is selected after its value materializes; that selected scene is then copied before rendering. Figure changes before resident-handle selection may appear in the export, while later changes do not alter the copied scene.

The file-export call can suspend during rendering or publication. Failures retain the rendering or filesystem cause; a rejected device or malformed host option has no file effect.

Examples

Export the active figure to PNG

x = 0:0.1:2*pi;
plot(x,sin(x));
print('sine_plot','-dpng');
info = imfinfo('sine_plot.png');

Export at a higher resolution

x = 0:0.1:1;
plot(x,x.^2,'LineWidth',2);
print('quadratic_plot','-dpng','-r300');
info = imfinfo('quadratic_plot.png');

Export a selected figure

fig = figure();
plot(1:5,[1 4 2 5 3]);
print(fig,'explicit_handle_plot.png','-dpng');
info = imfinfo('explicit_handle_plot.png');

Put the device option before the filename

plot(1:4,[1 3 2 4]);
print -dpng command_style_plot.png
info = imfinfo('command_style_plot.png');

Request the RunMat export status

plot(1:3,[2 1 3]);
ok = print('status_plot','-dpng');
info = imfinfo('status_plot.png');

Using print with coding agents

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

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

FAQ

Which formats does print support?⌄

PNG is available via -dpng or a .png filename. PDF, EPS, and SVG device tokens are recognized but unavailable in the current exporter.

Where is a browser export written?⌄

To the selected virtual filesystem. The browser host may expose that file as a downloadable artifact.

Does -r300 change plot data?⌄

No. It changes the exported pixel dimensions only.

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

  • Plot replay and export
  • Complete plotting guide

Source you can read

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

  • View the source for print 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 and options
  • Storage and execution
  • Examples
  • Export the active figure to PNG
  • Export at a higher resolution
  • Export a selected figure
  • Put the device option before the filename
  • Request the RunMat export status
  • Using print 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