quiver — Visualize 2-D vector fields with scalable arrows, GPU-aware execution, and MATLAB quiver call forms.
quiver visualizes 2-D vector fields as arrows anchored at data points. In RunMat it returns a quiver handle, supports MATLAB-style quiver(U, V) and quiver(X, Y, U, V) call forms, and uses GPU-backed geometry generation together with the plotting object, replay, and export systems.
How quiver works in RunMat
quiver(U, V)builds the default coordinate grid from the shape ofUandV.quiver(X, Y, U, V)accepts explicit coordinate vectors or meshgrid-style axes, depending on the input layout.- The returned value is a quiver-handle object that can be queried and updated through
getandset. - Auto-scale factor, head size, line width, color, and display-name workflows are all part of the plotting property path.
- Dedicated GPU geometry generation keeps vector-field rendering on device when plotting-compatible buffers are available.
Options
'AutoScaleFactor'/'Scale'controls arrow scaling.'MaxHeadSize'/'HeadSize'controls the size of arrowheads.- Line-style color and width workflows are supported through the same style parsing and handle/property path used by other line-like plots.
How quiver runs on the GPU
The direct quiver path emits renderer-ready arrow geometry from GPU buffers on the happy path.
Axes-local state, handle/property workflows, and replay/export behavior stay aligned across GPU and fallback rendering paths.
GPU memory and residency
quiver preserves GPU residency on the direct path by building arrow geometry from exported GPU buffers. If the direct geometry path is unavailable for the active input combination, RunMat falls back while preserving the same quiver semantics and handle behavior.
Examples
Create a vector field from U and V only
[X, Y] = meshgrid(-2:0.5:2, -2:0.5:2);
U = -Y;
V = X;
quiver(U, V);Expected output:
% RunMat infers the coordinate grid from the vector-field shapeProvide explicit coordinates for a flow field
[X, Y] = meshgrid(-2:0.5:2, -2:0.5:2);
U = -Y;
V = X;
quiver(X, Y, U, V);Adjust arrow scaling and head size through the handle
[X, Y] = meshgrid(-2:0.5:2, -2:0.5:2);
U = -Y;
V = X;
h = quiver(X, Y, U, V);
set(h, 'AutoScaleFactor', 1.5, 'MaxHeadSize', 0.2, 'DisplayName', 'rotation');
legend;Related functions to explore
These functions work well alongside quiver. Each page has runnable examples you can try in the browser.
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how quiver works, line by line, in Rust.
- View quiver.rs on GitHub
- Learn how the 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 — faster, on any GPU, with no license required.
- Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
- Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
- A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.