How can we plot 2D math vectors with matplotlib
? Does anyone have an example or suggestion about that?
I have a couple of vectors stored as 2D numpy
arrays, and I would like to plot them as directed edges.
The vectors to be plotted are constructed as below:
import numpy as np
# a list contains 3 vectors;
# each list is constructed as the tail and the head of the vector
a = np.array([[0, 0, 3, 2], [0, 0, 1, 1], [0, 0, 9, 9]])
Edit:
I just added the plot of the final answer of tcaswell
for anyone interested in the output and want to plot 2d vectors with matplotlib: