'Plot a 3D field of arrows.
call signatures::
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
*X*, *Y*, *Z*:
The x, y and z coordinates of the arrow locations (default is
tail of arrow; see *pivot* kwarg)
*U*, *V*, *W*:
The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they
they can be broadcast together. The arguments can also be
masked arrays. If an element in any of argument is masked, then
that corresponding quiver element will not be plotted.
Keyword arguments:
*length*: [1.0 | float]
The length of each quiver, default to 1.0, the unit is
the same with the axes
*arrow_length_ratio*: [0.3 | float]
The ratio of the arrow head with respect to the quiver,
default to 0.3
*pivot*: [ \'tail\' | \'middle\' | \'tip\' ]
The part of the arrow that is at the grid point; the arrow
rotates about this point, hence the name *pivot*.
Default is \'tail\'
*normalize*: [False | True]
When True, all of the arrows will be the same length. This
defaults to False, where the arrows will be different lengths
depending on the values of u,v,w.
Any additional keyword arguments are delegated to
:class:`~matplotlib.collections.LineCollection`'

def quiver(self, *args, **kwargs):

    def calc_arrow(uvw, angle=15):
        u'\n                                                To    calculate    the    arrow    head.    uvw    should    be    a    unit    vector.\n                                                We    normalize    it    here:\n                                                '
        norm = np.linalg.norm(uvw[:2])
        if (norm > 0):
            x = (uvw[1] / norm)
            y = ((- uvw[0]) / norm)
        else:
            (x, y) = (0, 1)
        ra = math.radians(angle)
        c = math.cos(ra)
        s = math.sin(ra)
        Rpos = np.array([[(c + ((x ** 2) * (1 - c))), ((x * y) * (1 - c)), (y * s)], [((y * x) * (1 - c)), (c + ((y ** 2) * (1 - c))), ((- x) * s)], [((- y) * s), (x * s), c]])
        Rneg = Rpos.copy()
        Rneg[([0, 1, 2, 2], [2, 2, 0, 1])] = (- Rneg[([0, 1, 2, 2], [2, 2, 0, 1])])
        return (Rpos.dot(uvw), Rneg.dot(uvw))
    had_data = self.has_data()
    length = kwargs.pop(u'length', 1)
    arrow_length_ratio = kwargs.pop(u'arrow_length_ratio', 0.3)
    pivot = kwargs.pop(u'pivot', u'tail')
    normalize = kwargs.pop(u'normalize', False)
    argi = 6
    if (len(args) < argi):
        ValueError((u'Wrong    number    of    arguments.    Expected    %d    got    %d' % (argi, len(args))))
    input_args = args[:argi]
    input_args = [([k] if isinstance(k, (int, float)) else k) for k in input_args]
    masks = [k.mask for k in input_args if isinstance(k, np.ma.MaskedArray)]
    bcast = np.broadcast_arrays(*(input_args + masks))
    input_args = bcast[:argi]
    masks = bcast[argi:]
    if masks:
        mask = reduce(np.logical_or, masks)
        input_args = [np.ma.array(k, mask=mask).compressed() for k in input_args]
    else:
        input_args = [k.flatten() for k in input_args]
    if any(((len(v) == 0) for v in input_args)):
        linec = art3d.Line3DCollection([], *args[argi:], **kwargs)
        self.add_collection(linec)
        return linec
    assert all((isinstance(k, np.ndarray) for k in input_args))
    assert (len({k.shape for k in input_args}) == 1)
    shaft_dt = np.linspace(0, length, num=2)
    arrow_dt = (shaft_dt * arrow_length_ratio)
    if (pivot == u'tail'):
        shaft_dt -= length
    elif (pivot == u'middle'):
        shaft_dt -= (length / 2.0)
    elif (pivot != u'tip'):
        raise ValueError((u'Invalid    pivot    argument:    ' + str(pivot)))
    XYZ = np.column_stack(input_args[:3])
    UVW = np.column_stack(input_args[3:argi]).astype(float)
    norm = np.sqrt(np.sum((UVW ** 2), axis=1))
    mask = (norm > 0)
    XYZ = XYZ[mask]
    if normalize:
        UVW = (UVW[mask] / norm[mask].reshape(((-1), 1)))
    else:
        UVW = UVW[mask]
    if (len(XYZ) > 0):
        shafts = (XYZ - np.multiply.outer(shaft_dt, UVW)).swapaxes(0, 1)
        head_dirs = np.array([calc_arrow(d) for d in UVW])
        heads = (shafts[:, :1] - np.multiply.outer(arrow_dt, head_dirs))
        heads.shape = (len(arrow_dt), (-1), 3)
        heads = heads.swapaxes(0, 1)
        lines = (list(shafts) + list(heads))
    else:
        lines = []
    linec = art3d.Line3DCollection(lines, *args[argi:], **kwargs)
    self.add_collection(linec)
    self.auto_scale_xyz(XYZ[:, 0], XYZ[:, 1], XYZ[:, 2], had_data)
    return linec
