def despine(ax):
    """Removes top and right spines from an Axes handle.

    Parameters
    ----------
    ax : matplotlib.Axes handle

    Returns
    -------
    ax : matplotlib.Axes handle
    """
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)
    return ax