code: def plot_detection(ax, rp_label, rpf_label):
      labels = []
      ylims = ax.get_ylim()
      height = ylims[1] - ylims[0]
      if not rp_label:
          r1 = ax.axhspan(
              ylims[0] + 0.06 * height,
              ylims[1] - 0.05 * height,
              edgecolor="r",
              facecolor="none",
              xmin=-test_time_start / test_duration - 0.005,
              xmax=(duration - test_time_start) / test_duration - 0.005,
          )
          labels.append(r1)
          ax.text(
              0.25,
              0.95,
              "RP",
              color="r",
              size=16,
              transform=ax.transAxes,
          )
      if not rpf_label:
          r2 = ax.axhspan(
              ylims[0] + 0.05 * height,
              ylims[1] - 0.06 * height,
              edgecolor="m",
              facecolor="none",
              xmin=-test_time_start / test_duration + 0.005,
              xmax=(duration - test_time_start) / test_duration + 0.005,
          )
          labels.append(r2)
          ax.text(
              0.65,
              0.95,
              "RPF",
              color="m",
              size=16,
              transform=ax.transAxes,
          )
      if rp_label and rpf_label:
          r3 = ax.axhspan(
              ylims[0] + 0.05 * height,
              ylims[1] - 0.05 * height,
              edgecolor="k",
              facecolor="none",
              xmin=-test_time_start / test_duration,
              xmax=(duration - test_time_start) / test_duration,
          )
          labels.append(r3)
      return labels
  
file_path: pyRiemann/examples/artifacts/plot_detect_riemannian_potato_field_EEG.py
imports: import numpy
  from matplotlib import pyplot
  from matplotlib.animation import FuncAnimation
  from mne.datasets import eegbci
  from mne.io import read_raw_edf
  from mne.channels import make_standard_montage
  from mne import make_fixed_length_epochs
  from pyriemann.estimation import Covariances
  from pyriemann.utils.covariance import normalize
  from pyriemann.clustering import Potato, PotatoField
label_desc: Use image node_id 2 for calling a global function with example usage: plot_detection(ax, rp_label, rpf_label) and returns: labels