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

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

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.

LicensePrivacy
/
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

addpoints — Append 2-D or 3-D coordinates to an animated line.

addpoints appends coordinates to a handle returned by animatedline. It updates the underlying line geometry and honors the handle's MaximumNumPoints limit by trimming oldest samples.

Syntax

addpoints(an, x, y)
addpoints(an, x, y, z)

Inputs

NameTypeRequiredDefaultDescription
anNumericArrayYes—Animated line handle.
xNumericArrayYes—X coordinates.
yNumericArrayYes—Y coordinates.
zNumericArrayYes—Z coordinates for 3-D animated lines.

Errors

IdentifierWhenMessage
RunMat:addpoints:InvalidArgumentThe handle is not an animated line, coordinates are invalid, or vector lengths differ.addpoints: invalid argument
RunMat:addpoints:InternalInternal plotting state update fails.addpoints: internal operation failed

How addpoints works

  • addpoints(an,x,y) appends 2-D points to an animated line.
  • addpoints(an,x,y,z) appends 3-D points. An empty 2-D animated line is promoted to a 3-D line when Z data is first added, unless the handle has marker metadata that the 3-D renderer cannot preserve.
  • Each X, Y, or Z coordinate independently accepts single, double, or any of the eight integer classes. Integer storage is read authoritatively before coordinates enter the host graphics representation.
  • Coordinate inputs must be scalars or vectors with matching element counts.
  • Logical coordinate values are not numeric integer coordinates and are rejected.
  • If the target is already 3-D, callers must provide X, Y, and Z coordinates.
  • The function mutates graphics state and has no MATLAB output.

Options

  • The first argument must be an animatedline handle.
  • X, Y, and optional Z coordinates may be single, double, or any integer class, including GPU-resident scalars or vectors.

Does RunMat run addpoints on the GPU?

The operation preserves graphics handle identity while replacing the stored line data.

The updated line continues through RunMat's existing line or line3 rendering path.

GPU memory and residency

addpoints gathers GPU-resident coordinate vectors before appending to host-side animated-line graphics state.

Examples

Append samples to an animated line

an = animatedline('MaximumNumPoints', 3);
addpoints(an, [1 2], [10 20]);
addpoints(an, [3 4], [30 40]);
get(an, 'YData')

Expected output:

ans =
    20    30    40

Append 3-D samples

an = animatedline();
addpoints(an, [1 2], [3 4], [5 6]);
get(an, 'Type')

Expected output:

ans =
    'animatedline'

Using addpoints with coding agents

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

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

FAQ

Can addpoints be used with ordinary line handles?⌄

No. The first argument must be a handle returned by animatedline; ordinary line and plot handles should be updated with set(h,'XData',...) and related properties.

Does addpoints clear the axes?⌄

No. It mutates the existing animated-line object in place.

Can I promote a marker-styled 2-D animated line to 3-D?⌄

No. RunMat rejects that promotion so marker metadata is not silently lost. Create a 3-D animated line without marker styling instead.

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

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

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how addpoints is executed, line by line, in Rust.

  • View the source for addpoints 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
  • Errors
  • How addpoints works
  • Options
  • Does RunMat run addpoints on the GPU?
  • GPU memory and residency
  • Examples
  • Append samples to an animated line
  • Append 3-D samples
  • Using addpoints with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • Open-source implementation
  • About RunMat