def despine(ax, top=True, left=True, bottom=True, right=True):
    """Selectively remove spines from an ``ax``."""
    for spine, on in zip(('top', 'left', 'bottom', 'right'), (top, left,
        bottom, right)):
        ax.spines[spine].set_visible(not on)
    return ax
