code: def get_color(index, data, cmap):
      """Return the data color of an index."""
      val = {
          "[0, 0]": data[0, 0],
          "[0, N']": data[0, -1],
          "[M', 0]": data[-1, 0],
          "[M', N']": data[-1, -1],
      }[index]
      return cmap(val / data.max())
  
file_path: matplotlib/galleries/users_explain/artists/imshow_extent.py
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.gridspec import GridSpec
label_desc: Use image node_id 3 for calling a global function with example usage: get_color(index, data, cmap) and returns: cmap