code: def _plot_epochs_image(
      image,
      style_axes=True,
      epochs=None,
      picks=None,
      vmin=None,
      vmax=None,
      colorbar=False,
      show=False,
      unit=None,
      cmap=None,
      ax=None,
      overlay_times=None,
      title=None,
      evoked=False,
      ts_args=None,
      combine=None,
      combine_given=False,
      norm=False,
  ):
      """Plot epochs image. Helper function for plot_epochs_image."""
      from matplotlib.ticker import AutoLocator
  
      if cmap is None:
          cmap = "Reds" if norm else "RdBu_r"
  
      tmin = epochs.times[0]
      tmax = epochs.times[-1]
  
      ax_im = ax["image"]
      # draw the image
      cmap = _setup_cmap(cmap, norm=norm)
      n_epochs = len(image)
      extent = [tmin, tmax, 0, n_epochs]
      im = ax_im.imshow(
          image,
          vmin=vmin,
          vmax=vmax,
          cmap=cmap[0],
          aspect="auto",
          origin="lower",
          interpolation="nearest",
          extent=extent,
      )
  
      # optional things
      if style_axes:
          ax_im.set_title(title)
          ax_im.set_ylabel("Epochs")
          if not evoked:
              ax_im.set_xlabel("Time (s)")
          ax_im.axis("auto")
          ax_im.axis("tight")
          ax_im.axvline(0, color="k", linewidth=1, linestyle="--")
  
      if overlay_times is not None:
          ax_im.plot(
              overlay_times, 0.5 + np.arange(n_epochs), "k", linewidth=2
          )
          ax_im.set_xlim(tmin, tmax)
      # draw the evoked
      if evoked:
          from .evoked import plot_compare_evokeds
  
          pass_combine = combine if combine_given else None
          _picks = (
              [0] if len(picks) == 1 else None
          )  # prevent applying GFP
          plot_compare_evokeds(
              {"cond": list(epochs.iter_evoked(copy=False))},
              picks=_picks,
              axes=ax["evoked"],
              combine=pass_combine,
              **ts_args,
          )
          ax["evoked"].set_xlim(tmin, tmax)
          ax["evoked"].lines[0].set_clip_on(True)
          ax["evoked"].collections[0].set_clip_on(True)
          _sharex(ax["evoked"], ax_im)
          # fix the axes for proper updating during interactivity
          loc = ax_im.xaxis.get_major_locator()
          ax["evoked"].xaxis.set_major_locator(loc)
          ax["evoked"].yaxis.set_major_locator(AutoLocator())
  
      fig = ax_im.get_figure()
  
      # draw the colorbar
      if colorbar:
          if "colorbar" in ax:  # axes supplied by user
              cax = ax["colorbar"]
              this_colorbar = cax.figure.colorbar(im, cax=cax)
              this_colorbar.ax.set_ylabel(
                  unit, rotation=270, labelpad=12
              )
          else:  # we created them
              this_colorbar = fig.colorbar(im, ax=ax_im)
              this_colorbar.ax.set_title(unit)
          if cmap[1]:
              ax_im.CB = DraggableColorbar(
                  this_colorbar, im, kind="epochs_image", ch_type=unit
              )
  
      # finish
      plt_show(show, fig=fig)
      return fig
  
file_path: mne-python/mne/viz/epochs.py
imports: from collections import Counter
  from copy import deepcopy
  import numpy
  from scipy.ndimage import gaussian_filter1d
  from .._fiff.meas_info import create_info
  from .._fiff.pick import _DATA_CH_TYPES_SPLIT, _VALID_CHANNEL_TYPES, _picks_to_idx
  from ..defaults import _handle_default
  from ..fixes import _sharex
  from ..utils import _check_option, fill_doc, legacy, logger, verbose, warn
  from ..utils.spectrum import _split_psd_kwargs
  from .raw import _setup_channel_selections
  from .utils import DraggableColorbar, _check_cov, _compute_scalings, _get_channel_plotting_order, _handle_decim, _handle_precompute, _make_combine_callable, _make_event_color_dict, _set_title_multiple_electrodes, _set_window_title, _setup_cmap, _setup_vmin_vmax, _validate_type, plt_show
label_desc: Use image node_id 4 for calling a global function with example usage: _plot_epochs_image(image, style_axes, epochs, picks, vmin, vmax, colorbar, show, unit, cmap, ax, overlay_times, title, evoked, ts_args, combine, combine_given, norm) and returns: fig