我想绘制一个简单的箭头图(例如Matplotlib图库中的示例:http://matplotlib.org/examples/pylab_examples/quiver_demo.html),但我不想启用自动缩放功能。我只想显示场的方向,而不是大小。
请问有没有办法将箭头大小设置为常数?我尝试了调整比例和比例单位,但这似乎只会将所有箭头都按某个公共因子进行更改。
谢谢
请问有没有办法将箭头大小设置为常数?我尝试了调整比例和比例单位,但这似乎只会将所有箭头都按某个公共因子进行更改。
谢谢
X, Y = np.meshgrid(np.arange(0, 2 * np.pi, .2), np.arange(0, 2 * np.pi, .2))
U = np.cos(X)
V = np.sin(Y)
# Normalize the arrows:
U = U / np.sqrt(U**2 + V**2);
V = V / np.sqrt(U**2 + V**2);
plt.figure()
plt.title('Normalized arrows')
Q = plt.quiver(X, Y, U, V, units='width')
qk = plt.quiverkey(Q, 0.9, 0.9, 2, r'$2 \frac{m}{s}$', labelpos='E',
coordinates='figure')