我正在尝试设置quiverkey与数据的特定箭头长度相匹配的绝对箭头长度quiver。有人可以告诉我这个quiverkey论点是如何U运作的,或者至少如何根据我的需要来扩展它吗?
背景
Python版本:3.6.5
matplotlib 版本:3.0.0
最小的例子
import matplotlib.pyplot as plt
import numpy as np
X = np.arange(-10, 11, 2)
Y = np.arange(-10, 11, 2)
U, V = np.meshgrid(X, Y)
# calculate length of each arrow
data_arrow_length = np.abs(np.sqrt(np.square(U[:]) + np.square(U[:])))
# set displayed arrow length for longest arrow
displayed_arrow_length = 2
# calculate scale factor for quiver
scale_factor = np.max(data_arrow_length)/displayed_arrow_length
# mysterious arrow length for quiverkey
quiverkey_length = 200
fig, …Run Code Online (Sandbox Code Playgroud)