def format_categorical_axes(
    ax,
    despine=['right', 'top']
    ):
    """Removes specified spines from plot on non-polar Axes.

    Parameters
    ----------
    ax : matplotlib.pyplot.Axes
        Axes handle to format.
    
    despine : list of string (optional, default=['right', 'top'])
        Items should be valid spine strings, including ['left', 'right', 'top',
        and 'bottom'].

    Returns
    -------
    ax : matplotlib Axes handle
    """
    for spine in despine:
        ax.spines[spine].set_visible(False)
    return ax