FUNCTION REFERENCE

quiver

Arrow plot of a vector field.

Arrow plot of a vector field.

Syntax

q = quiver(U, V)

Syntax

q = quiver(X, Y, U, V)

Syntax

q = quiver(..., scale)

Syntax

q = quiver(..., LineSpec)

Syntax

q = quiver(..., Name, Value)

Draws an arrow (U,V) at every point (X,Y); vector X and Y next to a matrix U are expanded as meshgrid(X,Y), same-size N-D arrays are flattened as columns, and quiver(U,V) uses the column and row numbers. Arrows are scaled as in GNU Octave: 0.9 (or scale) times the grid spacing over the longest arrow; a scale of 0, 'off' or 'AutoScale','off' draws them unscaled. Heads are 1/3 of the arrow (MaxHeadSize 0.2); a marker in the LineSpec marks the arrow bases and hides the heads, as in Octave. Options: AutoScale, AutoScaleFactor, MaxHeadSize, ShowArrowHead, Color, LineStyle, LineWidth, DisplayName. Returns a Quiver object (Type 'quiver'). Get/set and dot syntax support UData, VData, WData (quiver3), AutoScale, AutoScaleFactor, MaxHeadSize, ShowArrowHead, Color, LineStyle, LineWidth and Marker. XData/YData/ZData retain the NaN-separated shafts and heads for existing Line-property scripts; setting base coordinates or vector data regenerates the arrows.

Example

[x, y] = meshgrid(-2:2); q = quiver(x, y, -y, x); q.Type   % 'quiver'

Differences from MATLAB: Alignment is 'tail' only; a saved figure stores the arrows as a line.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.