diff --git a/src/toolbox_scs/detectors/digitizers.py b/src/toolbox_scs/detectors/digitizers.py
index 828f5a5754b55173409881ef4c321faa0cadadfd..067a75b22c345571346e2a91af8a751ecb84410b 100644
--- a/src/toolbox_scs/detectors/digitizers.py
+++ b/src/toolbox_scs/detectors/digitizers.py
@@ -663,15 +663,20 @@ def plotPeakIntegrationWindow(raw_trace, params, show_all=False):
     fig, ax = plt.subplots(1, 2, figsize=(6, 3), constrained_layout=True)
     for plot in range(2):
         title = 'First pulse' if plot == 0 else 'Last pulse'
-        i = 0 if plot == 0 else -1
-        ax[plot].axvline(baseStarts[i], ls='--', color='k')
-        ax[plot].axvline(baseStops[i], ls='--', color='k')
-        ax[plot].axvspan(baseStarts[i], baseStops[i],
-                      alpha=0.5, color='grey', label='baseline')
-        ax[plot].axvline(starts[i], ls='--', color='r')
-        ax[plot].axvline(stops[i], ls='--', color='r')
-        ax[plot].axvspan(starts[i], stops[i],
-                      alpha=0.2, color='r', label='peak')
+        i = 0 if plot == 0 else - 1
+        for j in range(min(2, len(starts))):
+            if plot == 1:
+                j = -j
+            label='baseline' if j == 0 else ''
+            ax[plot].axvline(baseStarts[i+j], ls='--', color='k')
+            ax[plot].axvline(baseStops[i+j], ls='--', color='k')
+            ax[plot].axvspan(baseStarts[i+j], baseStops[i+j],
+                          alpha=0.5, color='grey', label=label)
+            label='peak' if j == 0 else ''
+            ax[plot].axvline(starts[i+j], ls='--', color='r')
+            ax[plot].axvline(stops[i+j], ls='--', color='r')
+            ax[plot].axvspan(starts[i+j], stops[i+j],
+                          alpha=0.2, color='r', label=label)
         if len(starts) > 1:
             period = starts[1] - starts[0]
             xmin = np.max([0, baseStarts[i] - int(1.5*period)])