compass
Display arrows from the origin on a polar grid.
📝Syntax
compass(Z)
compass(U, V)
compass(..., LineSpec)
compass(..., propertyName, propertyValue)
compass(parent, ...)
h = compass(...)
📄Description

compass draws arrows starting from the origin toward the cartesian points defined by the input components on a polar grid.

With a single complex input Z, the real parts are the horizontal components and the imaginary parts are the vertical components; this is equivalent to compass(real(Z), imag(Z)).

With two real inputs U and V, each pair (U, V) is a cartesian point and the arrow points from the origin to that point. When U and V are matrices, one arrow is drawn for each element.

Each vector is drawn as a Line object made of a shaft from the origin and a short two-segment arrowhead, over a polar reference grid. h = compass(...) returns a column vector of Line objects, one per vector.

💡Examples
Display arrows from complex values.
Z = [1 + 2i, 2 - 1i, -1 + 1i];
compass(Z);
Use cartesian components with a line style and line properties.
U = [1 3 2];
V = [2 1 -1];
h = compass(U, V, '-r');
set(h, 'LineWidth', 1.5);
🔗See Also
compassplotfeatherquiver
Edit this page on GitHub