我有以下代码:
import matplotlib.pyplot as plt
x = [0.1,0.2]
y = [0.3,0.4]
dx = [0.5,0.5]
dy = [0.5,0.3]
ax = plt.axes()
ax.arrow(x[0], y[0], dx[0], dy[0], head_width=0.09, head_length=0.1)
ax.arrow(x[1], y[1], dx[1], dy[1], head_width=0.09, head_length=0.1)
plt.show()
现在想象一下x,y,dx,dy的维度比2大很多,让我们说1000.用每个箭头手工编写1000行会很痛苦。
是否有自动生成所有箭头的方法,因为我有向量x,y,dx,dy?