def arrow(ax, text, xy_start, xy_end, text_position='end', coords='data',
    rad=0.3, linewidth=None, lw=None, color=None, c=None, facecolor=None,
    fc=None, edgecolor=None, ec=None, text_kwargs={}, arrow_kwargs={}):
    """Draw a curved arrow on a plot

    Parameters
    ----------
    ax : matplotlib.axis
        Axis to draw on.
    test : string
        Text to put on one end of the arrow.
    xy_start : tuple of float
        (x,y)-coordinates where the arrow starts.
    xy_end : tuple of float
        (x,y)-coordinates where the arrow end.
    text_position : str (default : 'end')
        Where to put the text, either the 'end' of the
        arrow or the 'start' of the arrow.
    coords : str (default : 'data')
        Coordinate system of the provided coordinates, possibilities:
        'data' : coordinates of the data in plots
        'axes fraction' : fraction of the axis in [0,1]
        'figure fraction' : fraction of the figure in [0,1]
        Other styles:
        https://matplotlib.org/api/_as_gen/matplotlib.pyplot.annotate.html
    rad : float (default : 0.3)
        Curvature on the arrow. Can be negative
    linewidth or lw : float (default : 1.0)
        Width of the arrow in points.
    color or c : any matplotlib color (default : '#4a4e4d')
        color of the whole arrow (overridden by `facecolor`
        and `edgecolor`)
    facecolor or fc : facecolor of the arrow (default : '#4a4e4d')
        facecolor of the arrow
    edgecolor or ec : edgecolor of the arrow (default : '#4a4e4d')
        edgecolor of the arrow
    text_kwargs : dict (default : {})
    arrow_kwargs : dict (default : {})
    """
    arrowstyle = '<|-'
    if text_position == 'start':
        arrowstyle = '-|>'
        xy_start, xy_end = xy_end, xy_start
        rad *= -1
    if color is not None:
        c = color
    if c is None:
        c = '#4a4e4d'
    if facecolor is not None:
        fc = facecolor
    if fc is None:
        fc = c
    if edgecolor is not None:
        ec = edgecolor
    if ec is None:
        ec = c
    if linewidth is not None:
        lw = linewidth
    if lw is None:
        lw = 1.0
    ax.annotate(text, xy=xy_start, xycoords=coords, xytext=xy_end,
        textcoords=coords, arrowprops=dict(arrowstyle=arrowstyle,
        connectionstyle='arc3,rad={0}'.format(rad), facecolor=fc, edgecolor
        =ec, **arrow_kwargs), **text_kwargs)
