def _plot_extension(self, gta, prefix, src, loge_bounds=None, **kwargs):
        """Utility function for generating diagnostic plots for the
        extension analysis."""

        # format = kwargs.get('format', self.config['plotting']['format'])

        if loge_bounds is None:
            loge_bounds = (self.energies[0], self.energies[-1])

        name = src['name'].lower().replace(' ', '_')

        esuffix = '_%.3f_%.3f' % (loge_bounds[0], loge_bounds[1])

        p = ExtensionPlotter(src, self.roi, '',
                             self.config['fileio']['workdir'],
                             loge_bounds=loge_bounds)

        fig = plt.figure()
        p.plot(0)
        plt.gca().set_xlim(-2, 2)
        ROIPlotter.setup_projection_axis(0)
        annotate(src=src, loge_bounds=loge_bounds)
        plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                 '%s_%s_extension_xproj%s.png' % (
                                     prefix, name, esuffix)))
        plt.close(fig)

        fig = plt.figure()
        p.plot(1)
        plt.gca().set_xlim(-2, 2)
        ROIPlotter.setup_projection_axis(1)
        annotate(src=src, loge_bounds=loge_bounds)
        plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                 '%s_%s_extension_yproj%s.png' % (
                                     prefix, name, esuffix)))
        plt.close(fig)

        for i, c in enumerate(self.components):
            suffix = '_%02i' % i

            p = ExtensionPlotter(src, self.roi, suffix,
                                 self.config['fileio']['workdir'],
                                 loge_bounds=loge_bounds)

            fig = plt.figure()
            p.plot(0)
            ROIPlotter.setup_projection_axis(0, loge_bounds=loge_bounds)
            annotate(src=src, loge_bounds=loge_bounds)
            plt.gca().set_xlim(-2, 2)
            plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                     '%s_%s_extension_xproj%s%s.png' % (
                                         prefix, name, esuffix, suffix)))
            plt.close(fig)

            fig = plt.figure()
            p.plot(1)
            plt.gca().set_xlim(-2, 2)
            ROIPlotter.setup_projection_axis(1, loge_bounds=loge_bounds)
            annotate(src=src, loge_bounds=loge_bounds)
            plt.savefig(os.path.join(self.config['fileio']['workdir'],
                                     '%s_%s_extension_yproj%s%s.png' % (
                                         prefix, name, esuffix, suffix)))
            plt.close(fig)
Utility function for generating diagnostic plots for the
        extension analysis.