diff --git a/python/pfs/drp/stella/datamodel/pfsFiberArraySet.py b/python/pfs/drp/stella/datamodel/pfsFiberArraySet.py index dd003cd86..f7441b661 100644 --- a/python/pfs/drp/stella/datamodel/pfsFiberArraySet.py +++ b/python/pfs/drp/stella/datamodel/pfsFiberArraySet.py @@ -62,9 +62,10 @@ def plot(self, fiberId=None, usePixels=False, ignorePixelMask=0x0, show=True): colors = matplotlib.cm.rainbow(np.linspace(0, 1, len(fiberId))) for ff, cc in zip(fiberId, colors): - index = np.where(self.fiberId == ff)[0] - good = (self.mask[index] & ignorePixelMask) == 0 - axes.plot(wavelength[index][good], self.flux[index][good], ls="solid", color=cc) + index = np.where(self.fiberId == ff)[0][0] + good = ((self.mask[index] & ignorePixelMask) == 0) + lam = wavelength if usePixels else wavelength[index] + axes.plot(lam[good], self.flux[index][good], ls="solid", color=cc, label=str(ff)) axes.set_xlabel(xLabel) axes.set_ylabel("Flux")