animatedline — Create an animated line graphics object for incremental plotting.
animatedline creates a graphics handle backed by RunMat's normal 2-D or 3-D line rendering paths. The handle can be updated with addpoints and queried or styled with get and set.
Syntax
an = animatedline()
an = animatedline(x, y)
an = animatedline(x, y, z)
an = animatedline(..., Name, Value)
an = animatedline(ax, ...)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
args | Any | Variadic | — | Optional X/Y[/Z] vectors, axes target, and Name/Value properties. |
Returns
| Name | Type | Description |
|---|---|---|
an | NumericArray | Animated line graphics handle. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:animatedline:InvalidArgument | Coordinates, axes target, or Name/Value pairs are invalid. | animatedline: invalid argument |
RunMat:animatedline:Internal | Internal plotting state update fails. | animatedline: internal operation failed |
How animatedline works
animatedline()creates an empty animated line on the current axes.animatedline(x,y)creates a 2-D animated line with initial points.animatedline(x,y,z)creates a 3-D animated line when the initial coordinate vectors are nonempty.- A leading axes handle or
Parentname/value pair routes the animated line to explicit axes. MaximumNumPointslimits retained points by dropping the oldest samples. The default is 1000000;Infdisables trimming.- Returned handles report
Typeasanimatedlineand support line styling properties such asColor,LineWidth,LineStyle, marker properties for 2-D animated lines,DisplayName, andVisible.
Options
Parentaccepts an axes handle.MaximumNumPointsaccepts a positive numeric value orInf.- Common line properties include
Color,LineWidth,LineStyle,DisplayName, andVisible. Marker properties are supported for 2-D animated lines; 3-D animated lines reject marker metadata until RunMat's 3-D line renderer has marker support.
Does RunMat run animatedline on the GPU?
Construction gathers GPU coordinate vectors into the animated-line state.
Rendering still uses RunMat's existing line and line3 rendering paths after points are stored.
GPU memory and residency
animatedline accepts GPU-resident coordinate inputs but stores animated state as host-side graphics data so subsequent addpoints, get, and set operations have MATLAB-compatible handle semantics.
Examples
Create and update a 2-D animated line
an = animatedline('Color', 'r', 'MaximumNumPoints', 100);
addpoints(an, 1:3, [2 4 8]);
get(an, 'XData')Expected output:
ans =
1 2 3Create a 3-D animated line
an = animatedline();
addpoints(an, [1 2], [3 4], [5 6]);
get(an, 'ZData')Expected output:
ans =
5 6Using animatedline with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how animatedline changes the result.
Run a small animatedline example, explain the result, then change one input and compare the output.
FAQ
Does animatedline render through a separate animation engine?⌄
No. RunMat stores the animated-line handle as plotting state that points at the existing LinePlot or Line3Plot object, so updates reuse the established line rendering paths.
What happens when the maximum point count is exceeded?⌄
RunMat drops the oldest coordinates and keeps the newest MaximumNumPoints samples, matching MATLAB's compatibility behavior for streaming plots.
Can 3-D animated lines use marker properties?⌄
Not yet. RunMat rejects marker-styled 2-D animated-line handles when callers try to promote them with addpoints(an,x,y,z) because the current 3-D line renderer does not store marker metadata.
Related Plotting functions
2D Charts
area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem
Other
addpoints · ancestor · axes · barh · cla · clf · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · 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 · textscatter · textscatter3 · triplot · waitbar · wordcloud · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zoom
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how animatedline is executed, line by line, in Rust.
- View the source for animatedline 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.