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

text — Add text at a position in a 2-D or 3-D plot.

text(x,y,txt) adds an annotation at a 2-D position. Include z for a 3-D position, or provide an axes handle first to select the target axes.

Syntax

h = text(x, y, label)
h = text(x, y, label, Name, Value, ...)
h = text(x, y, z, label)
h = text(x, y, z, label, Name, Value, ...)
h = text(ax, x, y, label)
h = text(ax, x, y, z, label)
All supported text forms
h = text(x, y, label)
h = text(x, y, label, Name, Value, ...)
h = text(x, y, z, label)
h = text(x, y, z, label, Name, Value, ...)
h = text(ax, x, y, label)
h = text(ax, x, y, z, label)
text(x, y, label)
text(x, y, label, Name, Value, ...)
text(x, y, z, label)
text(x, y, z, label, Name, Value, ...)
text(ax, x, y, label)
text(ax, x, y, z, label)

Inputs

x
Type
NumericScalar
Required
Yes
Description
X coordinate.
y
Type
NumericScalar
Required
Yes
Description
Y coordinate.
label
Type
StringScalar
Required
Yes
Description
Annotation text.
props
Type
Any
Required
Variadic
Description
Name/value style options.
z
Type
NumericScalar
Required
Yes
Description
Z coordinate.
ax
Type
AxesHandle
Required
Yes
Description
Target axes handle.
NameTypeRequiredDefaultDescription
xNumericScalarYes—X coordinate.
yNumericScalarYes—Y coordinate.
labelStringScalarYes—Annotation text.
propsAnyVariadic—Name/value style options.
zNumericScalarYes—Z coordinate.
axAxesHandleYes—Target axes handle.

Returns

h
Type
NumericScalar
Description
Handle to the created text annotation.
NameTypeDescription
hNumericScalarHandle to the created text annotation.

Errors

RunMat:text:InvalidArgument
When
Coordinate, label, axes-target, or name/value text style arguments are invalid.
Message
text: invalid argument
RunMat:text:Internal
When
Internal plotting state update fails while creating annotation.
Message
text: internal operation failed
RunMat:text:TooManyOutputs
When
More than one output is requested.
Message
text: too many output arguments
IdentifierWhenMessage
RunMat:text:InvalidArgumentCoordinate, label, axes-target, or name/value text style arguments are invalid.text: invalid argument
RunMat:text:InternalInternal plotting state update fails while creating annotation.text: internal operation failed
RunMat:text:TooManyOutputsMore than one output is requested.text: too many output arguments

Behavior

Coordinates can use single, double, or any of the eight integer classes.

The Position property retains the coordinate class, shape, and exact values. Rendering uses a separate floating-point geometry cache.

A two-element Position value is stored with a third coordinate of zero in the same numeric class.

The returned graphics handle supports get and set for String, Position, FontWeight, FontAngle, Interpreter, Color, FontSize, and Visible.

Typed-integer numeric axes aliases and explicit gpuArray coordinates are RunMat-mode extensions.

Placement and execution

This command mutates local graphics scene state and may notify the graphics host. Inputs and returned graphics handles are host-owned; worker transfer of numeric handle values does not transfer scene ownership.

Interpreter and compiled routes use the same runtime operation; a browser graphics host or desktop graphics host is required for presentation.

Examples

Label a point on a curve

plot(1:5, [2 4 3 5 4]);
h = text(4, 5, "peak");

Add a 3-D annotation

plot3(1:3, 2:4, 5:7);
h = text(2, 3, 6, "sample");

Use integer coordinates

h = text(int64(12), int64(-3), "checkpoint");
position = get(h, "Position")

Expected output:

position = 1×3 int64
    12    -3     0

Using text with coding agents

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

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

FAQ

Are integer positions converted to double?⌄

No. The graphics property keeps native integer storage and exact values. Only the derived coordinates sent to the renderer are converted.

Can text label several points in one call?⌄

Not yet. Each call currently accepts one scalar 2-D or 3-D position; vector coordinates and per-point label arrays remain unsupported.

Can I pass resident coordinates?⌄

Automatically resident coordinates are gathered transparently through their owning provider. Explicit gpuArray coordinates require RunMat mode because the current public compatibility target does not document an interactive GPU form for text.

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 · print · quiver3 · ribbon · saveas · savefig · sphere · spring · stackedplot · subtitle · summer · suptitle · 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

Source you can read

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

  • View the source for text 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
  • Placement and execution
  • Examples
  • Label a point on a curve
  • Add a 3-D annotation
  • Use integer coordinates
  • Using text with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • Source you can read
  • About RunMat