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 more information on contour plotting).
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
[ Previous | Help Desk | Next ]