code: def _plot_heatmap_array(
      data,
      width,
      height,
      cmap=None,
      alpha=None,
      vmin=None,
      vmax=None,
      axes=None,
      show=True,
  ):
      """Plot a heatmap of eyetracking gaze data from a numpy array."""
      import matplotlib.pyplot as plt
  
      # Prepare axes
      if axes is not None:
          from matplotlib.axes import Axes
  
          _validate_type(axes, Axes, "axes")
          ax = axes
          fig = ax.get_figure()
      else:
          fig, ax = plt.subplots(constrained_layout=True)
  
      ax.set_title("Gaze heatmap")
      ax.set_xlabel("X position")
      ax.set_ylabel("Y position")
  
      # Prepare the heatmap
      alphas = 1 if alpha is None else alpha
      vmin = np.nanmin(data) if vmin is None else vmin
      vmax = np.nanmax(data) if vmax is None else vmax
      extent = [
          0,
          width,
          height,
          0,
      ]  # origin is the top left of the screen
  
      # Plot heatmap
      im = ax.imshow(
          data,
          aspect="equal",
          cmap=cmap,
          alpha=alphas,
          extent=extent,
          origin="upper",
          vmin=vmin,
          vmax=vmax,
      )
  
      # Prepare the colorbar
      fig.colorbar(im, ax=ax, shrink=0.6, label="Dwell time (seconds)")
      plt_show(show)
      return fig
  
imports: import numpy
  from scipy.ndimage import gaussian_filter
  from ...utils import _ensure_int, _validate_type, fill_doc, logger
  from ..utils import plt_show
label_desc: Use image node_id 2 for calling a global function with example usage: _plot_heatmap_array(data, width, height, cmap, alpha, vmin, vmax, axes, show) and returns: fig