quiver3

Plots a 3-D vector field as arrows.

Category: Graphics > 2-D and 3-D Plots

Syntax

quiver3(X, Y, Z, U, V, W)

Draws an arrow at each point (X, Y, Z) with components (U, V, W).

quiver3(Z, U, V, W)

Places the arrows over the surface Z on an evenly spaced grid.

quiver3(___, scale)

Scales the arrow length.

h = quiver3(___)

Also returns the Quiver object.

Description

It is the 3-D version of quiver. A common use is to draw the surface normals of a surface returned by surfnorm, or the velocity field of a flow. The result is easier to interpret with view(3) and axis equal.

Input arguments

X, Y, Z
Arrow base positions.
U, V, W
Vector components, the same size as the positions.

Output arguments

h
Quiver object.

Example

Normals of a cone-like surface

[x, y] = meshgrid(-1:0.5:1);
z = sqrt(x.^2 + y.^2);
[u, v, w] = surfnorm(x, y, z);
surf(x, y, z)
hold on
quiver3(x, y, z, u, v, w)
hold off

In the app, the figure is drawn below the code.

See also

quiver surfnorm streamline plot3 meshgrid