Graphics | ![]() ![]() |
Two-Dimensional Quiver Plots
The quiver
function shows vectors at given points in two-dimensional space. The vectors are defined by x and y components.
A quiver plot is useful when displayed with another plot. For example, create 10 contours of the peaks
function (see the "Contour Plots" section for more information).
n = -2.0:.2:2.0; [X,Y,Z] = peaks(n); contour(X,Y,Z,10)
Now use gradient
to create the vector components to use as inputs to quiver
.
[U,V] = gradient(Z,.2);
Set hold
to on
and add the contour plot.
hold on quiver(X,Y,U,V) hold off
![]() | Feather Plots | Three-Dimensional Quiver Plots | ![]() |