def plot_pair_wise_scatter(x, y, boxlim, box_init, restricted_dims):
    ' helper function for pair wise scatter plotting\n\n    Parameters\n    ----------\n    x : DataFrame\n        the experiments\n    y : numpy array\n        the outcome of interest\n    box_lim : DataFrame\n              a boxlim\n    box_init : DataFrame\n    restricted_dims : collection of strings\n                      list of uncertainties that define the boxlims\n\n    '
    x = x[restricted_dims]
    data = x.copy()
    categorical_columns = data.select_dtypes('category').columns.values
    categorical_mappings = {}
    for column in categorical_columns:
        categories_inbox = boxlim.at[(0, column)]
        categories_all = box_init.at[(0, column)]
        missing = (categories_all - categories_inbox)
        categories = (list(categories_inbox) + list(missing))
        print(column, categories)
        data[column] = data[column].cat.set_categories(categories)
        categorical_mappings[column] = dict(enumerate(data[column].cat.categories))
        data[column] = data[column].cat.codes
    data['y'] = y
    grid = sns.pairplot(data=data, hue='y', vars=x.columns.values)
    cats = set(categorical_columns)
    for (row, ylabel) in zip(grid.axes, grid.y_vars):
        ylim = boxlim[ylabel]
        if (ylabel in cats):
            y = (- 0.2)
            height = (len(ylim[0]) - 0.6)
        else:
            y = ylim[0]
            height = (ylim[1] - ylim[0])
        for (ax, xlabel) in zip(row, grid.x_vars):
            if (ylabel == xlabel):
                continue
            if (xlabel in cats):
                xlim = boxlim.at[(0, xlabel)]
                x = (- 0.2)
                width = (len(xlim) - 0.6)
            else:
                xlim = boxlim[xlabel]
                x = xlim[0]
                width = (xlim[1] - xlim[0])
            xy = (x, y)
            box = patches.Rectangle(xy, width, height, edgecolor='red', facecolor='none', lw=3)
            ax.add_patch(box)
    for (row, ylabel) in zip(grid.axes, grid.y_vars):
        if (ylabel in cats):
            ax = row[0]
            labels = []
            for entry in ax.get_yticklabels():
                (_, value) = entry.get_position()
                try:
                    label = categorical_mappings[ylabel][value]
                except KeyError:
                    label = ''
                labels.append(label)
            ax.set_yticklabels(labels)
    for (ax, xlabel) in zip(grid.axes[(- 1)], grid.x_vars):
        if (xlabel in cats):
            labels = []
            locs = []
            mapping = categorical_mappings[xlabel]
            for i in range((- 1), (len(mapping) + 1)):
                locs.append(i)
                try:
                    label = categorical_mappings[xlabel][i]
                except KeyError:
                    label = ''
                labels.append(label)
            ax.set_xticks(locs)
            ax.set_xticklabels(labels, rotation=90)
    return grid
helper function for pair wise scatter plotting

Parameters
----------
x : DataFrame
    the experiments
y : numpy array
    the outcome of interest
box_lim : DataFrame
          a boxlim
box_init : DataFrame
restricted_dims : collection of strings
                  list of uncertainties that define the boxlims
def plot_pair_wise_scatter(x, y, boxlim, box_init, restricted_dims):
    ' helper function for pair wise scatter plotting\n\n    Parameters\n    ----------\n    x : DataFrame\n        the experiments\n    y : numpy array\n        the outcome of interest\n    box_lim : DataFrame\n              a boxlim\n    box_init : DataFrame\n    restricted_dims : collection of strings\n                      list of uncertainties that define the boxlims\n\n    '
    x = x[restricted_dims]
    data = x.copy()
    categorical_columns = data.select_dtypes('category').columns.values
    categorical_mappings = {}
    for column in categorical_columns:
        categories_inbox = boxlim.at[(0, column)]
        categories_all = box_init.at[(0, column)]
        missing = (categories_all - categories_inbox)
        categories = (list(categories_inbox) + list(missing))
        print(column, categories)
        data[column] = data[column].cat.set_categories(categories)
        categorical_mappings[column] = dict(enumerate(data[column].cat.categories))
        data[column] = data[column].cat.codes
    data['y'] = y
    grid = sns.pairplot(data=data, hue='y', vars=x.columns.values)
    cats = set(categorical_columns)
    for (row, ylabel) in zip(grid.axes, grid.y_vars):
        ylim = boxlim[ylabel]
        if (ylabel in cats):
            y = (- 0.2)
            height = (len(ylim[0]) - 0.6)
        else:
            y = ylim[0]
            height = (ylim[1] - ylim[0])
        for (ax, xlabel) in zip(row, grid.x_vars):
            if (ylabel == xlabel):
                continue
            if (xlabel in cats):
                xlim = boxlim.at[(0, xlabel)]
                x = (- 0.2)
                width = (len(xlim) - 0.6)
            else:
                xlim = boxlim[xlabel]
                x = xlim[0]
                width = (xlim[1] - xlim[0])
            xy = (x, y)
            box = patches.Rectangle(xy, width, height, edgecolor='red', facecolor='none', lw=3)
            ax.add_patch(box)
    for (row, ylabel) in zip(grid.axes, grid.y_vars):
        if (ylabel in cats):
            ax = row[0]
            labels = []
            for entry in ax.get_yticklabels():
                (_, value) = entry.get_position()
                try:
                    label = categorical_mappings[ylabel][value]
                except KeyError:
                    label = 
                labels.append(label)
            ax.set_yticklabels(labels)
    for (ax, xlabel) in zip(grid.axes[(- 1)], grid.x_vars):
        if (xlabel in cats):
            labels = []
            locs = []
            mapping = categorical_mappings[xlabel]
            for i in range((- 1), (len(mapping) + 1)):
                locs.append(i)
                try:
                    label = categorical_mappings[xlabel][i]
                except KeyError:
                    label = 
                labels.append(label)
            ax.set_xticks(locs)
            ax.set_xticklabels(labels, rotation=90)
    return grid