Plotting an array of vectors in Python (pyplot)
<p>I'm trying to plot a large array of vectors using pyplot. Right now I've got</p>

<pre><code>import matplotlib.pyplot as plt
import numpy as np
import operator

t = np.arange(0, np.pi, .01)


def pos1(t):
    x1 = .72 * np.cos(13*t)
    y1 = .72 * np.sin(13*t)
    return x1, y1


def pos2(t):
    x2 = np.cos(8*t)
    y2 = np.sin(8*t)
    return x2, y2


def vec(t):
    x1 = pos1(t)[0]
    x2 = pos2(t)[0]
    y1 = pos1(t)[1]
    y2 = pos2(t)[1]
    x = np.subtract(x1, x2)
    y = np.subtract(y1, y2)
    return x, y


X = pos2(t)[0]
Y = pos2(t)[1]
U = vec(t)[0]
V = vec(t)[1]

plot1 = plt.figure()
plt.quiver(X, Y, U, V, headlength=4)
plt.show(plot1)
</code></pre>

<p>Where <code>pos1(t)</code>, <code>pos2(t)</code> and <code>vec(t)</code> are functions that return a tuple of the form <code>([a,...,z],[a1,...,z1])</code>.</p>

<p>This plot gives me something close to what I want, but the vector lengths are all wrong. the two functions, <code>pos1(t),pos2(t)</code> return a tuple of the point on a particular curve, and the <code>vec(t)</code> function is their difference, leading to a vector from a point on the first curve to a point on the second. My plot has the correct direction, but not magnitude. </p>

<p><a href="https://i.stack.imgur.com/4sod4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4sod4.png" alt="enter image description here"></a></p>