def _prep_labels(df, hue=None, style=None, col=None, row=None):
    """Prepare labels for custom legend.

    In order to create our custom legend for our custom facetting, need some
    extra info.

    Parameters
    ----------
    df : pd.DataFrame
        Dataframe containing the data we'll plot.
    hue, style, col, row : str or None, optional
        variables to plot on axes or facet along.

    Returns
    -------
    label : str or None
        Whether we'll be using style, hue, both or neither to label data for
        the legend. Intended to be passed to _facetted_scatter_ci_dist.
    all_labels : list
        List of possible labels for the legend. Intended to be passed to
        _facetted_scatter_ci_dist.

    """
    if hue is not None and (style is None or style == col or style == row):
        all_labels = list(df[hue].unique())
        label = 'hue'
    elif style is not None and hue is None:
        all_labels = list(df[style].unique())
        label = 'style'
    elif style is not None and hue is not None:
        try:
            all_labels = [n for n, _ in df.groupby([style, hue])]
            gb_style = [style]
        except ValueError:
            # then style is a list
            gb_style = [s for s in style if s != row and s != col]
            all_labels = [n for n, _ in df.groupby([*gb_style, hue])]
        label = 'both'
    else:
        all_labels = [None]
        label = None
    return label, all_labels