def insert_arrows(x, y, ax, num_arrows=10, **kwargs):
    """
    Helper functon to add arrows on a plot of y vs. x.

    Args:
        x (np.ndarray): x coordinates
        y (np.ndarray): x coordinates
        num_arrows (int): number of arrows desired
        **kwargs: keyword arguments sent to ax.arrow
    
    Returns:
        ax: matplotlib axis
    """
    N = len(x)
    for i in range(0, N, N // num_arrows + 1):
        x_val = x[i]
        y_val = y[i]
        dx = x[i + 1] - x[i]
        dy = y[i + 1] - y[i]
        ax.arrow(x_val, y_val, dx, dy, **kwargs)
    return ax