title: Plotting randomly selected vectors using quiver (python, matplotlib)
body: <p>I start with a given vector field defined in two dimensions. I want to randomly pick M points in a 1 by 1 square, and plot the vectors that correspond to the desired vector field at those randomly selected points, using quiver from matplotlib.pyplot</p>
  <pre><code>import numpy as np
  from math import *
  import sys
  import matplotlib.pyplot as plt
  import numpy.random as rn
  
  L=1
  
  def dipole(x,y): #This is the vector field
     Bx = 0 
     By = 0
     position = [0,0]
     moment = [0,1]
     R = (x-position[0])**2+(y-position[1])**2
     R = np.sqrt(R)
     A = 3*(moment[0]*(x-position[0])+moment[1]*(y-position[1]))/R**5
     Bx = A*(x-position[0])-moment[0]/R**3
     By = A*(y-position[1])-moment[1]/R**3
     return np.array([Bx,By])
  
  #We now choose M random vectors in the square
  
  xm = [] #array of random vector positions
  vectors = [] #vectors at the random positions
  M = int(1e1) #number of vectors
  
  for i in range(M):
     random_point = [rn.uniform(-L,L),rn.uniform(-L,L)]
     xm.append(random_point)
     vectors.append([dipole(random_point[0],random_point[1]). [0],dipole(random_point[0],random_point[1])[1]])
  
  xm = np.array(xm)
  vectors = np.array(vectors)                         
  
  plt.quiver(xm,vectors[:,0],vectors[:,1])
  </code></pre>
  <p>returns</p>
  <pre><code>ValueError: Argument V has a size 10 which does not match 20, the number of arrow positions
  </code></pre>
  <p>Writing</p>
  <pre><code>plt.quiver([xm[:,0],xm[:,1]],np.array(vectors[:,0]),np.array(vectors[:,1]))
  </code></pre>
  <p>instead does not help. Any suggestions? Thanks</p>