Plots vectors that start at 'points', and move along 'directions'.

def vector_field(points, directions, title=None, fig='current', ax=None,
                 edge_style='k-', vertex_style='o'):
  '''Plots vectors that start at 'points', and move along 'directions'.'''
  assert points.shape[1] in (2,3) and directions.shape == points.shape
  ax = _get_axis(fig, ax, points.shape[1] == 3)
  # Plot.
  if points.shape[1] == 2:
    x,y = points.T
    dx,dy = directions.T
    if hasattr(ax, 'zaxis'):  # Must be on a 3d plot axis, so supply zeros.
      _quiver3d(ax, x, y, 0, dx, dy, 0, arrow_length_ratio=0.1)
    else:
      args = (x, y, dx, dy)
      ax.quiver(*args, angles='xy', scale_units='xy', scale=1, headwidth=5)
    if vertex_style is not None:
      ax.scatter(x, y, marker=vertex_style, zorder=2, edgecolor='none')
  else:
    x,y,z = points.T
    dx,dy,dz = directions.T
    _quiver3d(ax, x, y, z, dx, dy, dz, arrow_length_ratio=0.1)
    if vertex_style is not None:
      ax.scatter(x, y, z, marker=vertex_style, zorder=2, edgecolor='none')
  if title:
    ax.set_title(title)
  return plt.show