% M_QUIVER Makes a quiverplot on a map (QUIVER-style) % M_QUIVER(LONG,LAT,U,V) plots velocity vectors as arrows with components % (U,V) at the points (LONG,LAT) on the currently defined map. The % matrices LONG,LAT,U,V must all be the same size. U a
quiver绘制表示梯度变化非常有用,下面是学习过程中给出的两个例子,可以很好理解quiver的用法
from pylab import *
close()
## example 1
x = linspace(0,10,40)
y = x**2*exp(-x)
u = array([x[i+1]-x[i] for i in range(len(x)-1)])
v = array([y[i+1]-y[i] for i in range(len(x)-1)])
x = x[:len(u)] # 使