//  [python]
def plot_energy_rate_boxplots(self, df, column_for_grouping, color_map, output_dir):
        # energy rate box plot comparisons by building type and several disaggregations

        # Columns to summarize
        cols_to_summarize = [
            self.col_name_to_energy_rate(self.UTIL_BILL_ELEC),
            self.col_name_to_energy_rate(self.UTIL_BILL_GAS),
        ]

        # Disaggregate to these levels
        group_bys = [
            self.CEN_DIV,
            self.BLDG_TYPE
        ]

        for col in cols_to_summarize:
            # for bldg_type, bldg_type_ts_df in df.groupby(self.BLDG_TYPE):

            # Make a plot for each group
            for group_by in group_bys:
                if group_by is None:
                    # No group-by
                    g = sns.boxplot(
                        data=df,
                        y=column_for_grouping,
                        x=col,
                        order=list(color_map.keys()),
                        palette=color_map.values(),
                        orient='h',
                        showfliers=False,
                        showmeans=True,
                        meanprops={"marker":"d",
                            "markerfacecolor":"yellow",
                            "markeredgecolor":"black",
                            "markersize":"8"
                        }
                    )
                    plt.legend(title=self.col_name_to_nice_name(column_for_grouping))

                else:
                    # With group-by
                    g = sns.boxplot(
                        data=df,
                        x=col,
                        y=group_by,
                        order=self.ORDERED_CATEGORIES[group_by],
                        hue=column_for_grouping,
                        hue_order=list(color_map.keys()),
                        palette=color_map.values(),
                        orient='h',
                        showfliers=False,
                        showmeans=True,
                        meanprops={"marker":"d",
                            "markerfacecolor":"yellow",
                            "markeredgecolor":"black",
                            "markersize":"8"
                        },
                    )
                    plt.legend(title=self.col_name_to_nice_name(column_for_grouping))
                    g.figure.set_size_inches(12, 6)

                fig = g.figure

                # Extract the units from the column name
                units = self.nice_units(self.units_from_col_name(col))

                # Titles and axis labels
                col_title = self.col_name_to_nice_name(col)
                # col_title = col.replace(f' {units}', '')
                # col_title = col_title.replace('Normalized Annual ', '')
                fuel = self.col_name_to_fuel(col_title)

                # Formatting
                if group_by is None:
                    # No group-by
                    title = f"Boxplot of {col_title}".title()
                    g.set_xlabel(f'{fuel} rate ({units})')
                    g.set_ylabel('')
                else:
                    # With group-by
                    gb = self.col_name_to_nice_name(group_by)
                    title = f"Boxplot of {col_title} by {f'{gb}'}".title()
                    g.set_xlabel(f'{fuel} rate ({units})')
                    g.set_ylabel(f'{gb}')

                # Save figure
                title = title.replace('\n', '')
                fig_name = f'{title.replace(" ", "_").lower()}.{self.image_type}'
                fig_name = fig_name.replace('boxplot_of_', 'bp_')
                # fig_name = fig_name.replace('total_energy_consumption_', '')
                fig_path = os.path.abspath(os.path.join(output_dir, fig_name))
                plt.savefig(fig_path, bbox_inches = 'tight')
                plt.close()