def plotmca(self, mca, title=None, set_title=True, as_mca2=False,
                fullrange=False, init=False, **kws):
        if as_mca2:
            self.mca2 = mca
            kws['new'] = False
        else:
            self.mca = mca
            self.panel.conf.show_grid = False

        if init:
            self.xview_range = (min(self.mca.energy), max(self.mca.energy))
        else:
            self.xview_range = self.panel.axes.get_axes().get_xlim()


        atitles = []
        if self.mca is not None:
            if hasattr(self.mca, 'title'):
                atitles.append(self.mca.title)
            if hasattr(self.mca, 'filename'):
                atitles.append(" File={:s}".format(self.mca.filename))
            if hasattr(self.mca, 'npixels'):
                atitles.append(" {:.0f} Pixels".format(self.mca.npixels))
            if hasattr(self.mca, 'real_time'):
                try:
                    rtime_str = " RealTime={:.2f} sec".format(self.mca.real_time)
                except ValueError:
                    rtime_str = " RealTime= %s sec".format(str(self.mca.real_time))
                atitles.append(rtime_str)

            try:
                self.plot(self.mca.energy, self.mca.counts,
                          mca=self.mca, **kws)
            except __HOLE__:
                pass
        if as_mca2:
            if hasattr(self.mca2, 'title'):
                atitles.append(" BG={:s}".format(self.mca2.title))
            elif  hasattr(self.mca2, 'filename'):
                atitles.append(" BG_File={:s}".format(self.mca2.filename))
            if hasattr(self.mca, 'real_time'):
                atitles.append(" BG_RealTime={:.2f} sec".format(self.mca2.real_time))

            self.oplot(self.mca2.energy, self.mca2.counts,
                       mca=self.mca2, **kws)
        if title is None:
            title =' '.join(atitles)
        if set_title:
            self.SetTitle(title)
dataset/ETHPy150Open xraypy/xraylarch/plugins/wx/xrfdisplay.py/XRFDisplayFrame.plotmca