RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact
  • License
  • Privacy

Learn

  • Docs
  • Blog
  • Benchmarks
  • RunMat vs MATLAB Online

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

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
    • axes
    • axis
    • bar
    • barh
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • copyobj
    • daspect
    • datacursormode
    • dataTipTextRow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • image
    • imagesc
    • imshow
    • legend
    • line
    • linkaxes
    • loglog
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • view
    • waitbar
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

print — Export figures to files in MATLAB and RunMat.

print exports the active or specified figure to files. Device tokens, resolution options, and argument forms follow MATLAB-style print semantics in RunMat.

Syntax

ok = print(filename, '-dpng')
ok = print(filename, '-dpng', '-r300')
ok = print(fig, filename, '-dpng')
ok = print('-dpng', filename)

Inputs

NameTypeRequiredDefaultDescription
argsAnyVariadic—Optional figure handle, filename, device token such as '-dpng', and resolution token such as '-r300'.

Returns

NameTypeDescription
okLogicalArrayTrue when the export completed.

Errors

IdentifierWhenMessage
RunMat:print:InvalidInputArguments are missing, malformed, or cannot be interpreted as a supported print form.print: invalid input arguments
RunMat:print:UnsupportedDeviceThe requested output device is not supported by the active exporter.print: unsupported output device
RunMat:print:InvalidOptionA print option token is unsupported or invalid.print: invalid option
RunMat:print:RenderFailedThe figure renderer fails while serializing the figure.print: figure export failed
RunMat:print:IoFailureThe exported bytes cannot be written to the target file.print: file I/O failed
—Internal runtime control-flow or conversion fails.print: internal error

How print works

  • A typed-integer numeric figure-registry alias is a RunMat-mode extension and must map exactly to the floating handle registry; resolution remains a textual option such as '-r300'.
  • print(filename, '-dpng') writes PNG bytes to filename. If the name has no .png extension, RunMat appends one.
  • print(filename, '-dpng', '-rN') scales the export dimensions from the default 800 by 600 canvas using N DPI relative to RunMat's 150 DPI default.
  • print(fig, filename, '-dpng') exports the specified figure handle instead of the active figure.
  • Command-style argument order is accepted when RunMat parses command calls into string arguments, such as print -dpng plot.png.
  • PDF, EPS, and SVG device tokens are recognized but return a clear unsupported-device error until those exporters are implemented.

Does RunMat run print on the GPU?

No numeric GPU kernels are launched for print itself.

The PNG exporter first attempts the interactive GPU render path and falls back to CPU rasterization when headless GPU initialization is unavailable.

The builtin writes PNG bytes through RunMat's filesystem layer, so output storage is host or virtual-filesystem backed.

GPU memory and residency

print is an I/O sink and returns a host logical status. Filename and option arguments are gathered before parsing. GPU-resident plot data already captured in figure state may still be consumed by the plotting renderer without forcing user-visible gathers when the shared WGPU export path is available.

Examples

Export the active figure to a PNG file

x = 0:0.1:2*pi;
plot(x, sin(x));
print("sine_plot", "-dpng");

Export at a higher resolution

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

Export a specific figure handle

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

Command-style device order

plot(1:4, [1 3 2 4]);
print -dpng command_style_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 supported today with -dpng. RunMat recognizes PDF, EPS, and SVG device tokens, but they return an unsupported-device error until those exporters are available in the rendering stack.

Where does the file go in the browser?⌄

The PNG is written through RunMat's filesystem provider. In the sandbox this is usually the in-memory or IndexedDB-backed virtual filesystem, and the host can expose the file as a download artifact.

Does -r300 change the figure data?⌄

No. It only changes the pixel dimensions used for export. The plot data and graphics handles remain unchanged.

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 · axes · barh · caxis · cla · clf · clim · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · text · textscatter · textscatter3 · triplot · waitbar · 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

Open-source implementation

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

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How print works
  • Does RunMat run print on the GPU?
  • GPU memory and residency
  • Examples
  • Export the active figure to a PNG file
  • Export at a higher resolution
  • Export a specific figure handle
  • Command-style device order
  • Using print with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • More plotting resources
  • Open-source implementation
  • About RunMat