I would like to plot three vectors, b
, d
, and d-b
. Of course, this means that the tail of d-b
touches the head of b
. I'm using this SO to plot arrows. However, I clearly don't understand the API, since the figure I get is baffling. The arrows look roughly like they're in the right directions, but the magnitudes are way off. Not sure what I'm doing wrong here.
import numpy as np
import matplotlib.pyplot as plt
b = np.array([4, 1])
d = np.array([-3, 3])
m = d-b
o = np.array([
[0, 0, b[0]],
[0, 0, b[1]]
])
v = np.array([
[b[0], b[1]],
[d[0], d[1]],
[m[0], m[1]]
])
fig, ax = plt.subplots()
ax.quiver(*o, v[:, 0], v[:, 1])
plt.show()