code: def make_col_list(unique_vals, nclasses=None, cmap=None):
      """
      Convert a matplotlib named colormap into a discrete list of n-colors in
      RGB format.
  
      Parameters
      ----------
      unique_vals : list
          A list of values to make a color list from.
      nclasses : int (optional)
          The number of classes.
      cmap : str (optional)
          Colormap name used to create output list.
  
      Returns
      -------
      list
          A list of colors based on the given set of values in matplotlib
          format.
  
      Example
      -------
      >>> import numpy as np
      >>> import earthpy.plot as ep
      >>> import matplotlib.pyplot as plt
      >>> arr = np.array([[1, 2], [3, 4], [5, 4], [5, 5]])
      >>> f, ax = plt.subplots()
      >>> im = ax.imshow(arr, cmap="Blues")
      >>> the_legend = ep.draw_legend(im_ax=im)
      >>> # Get the array and cmap from axis object
      >>> cmap_name = im.axes.get_images()[0].get_cmap().name
      >>> unique_vals = list(np.unique(im.get_array().data))
      >>> cmap_colors = ep.make_col_list(unique_vals, cmap=cmap_name)
  
      """
      if not nclasses:
          nclasses = len(unique_vals)
  
      increment = 1 / (nclasses - 1)
  
      # Create increments to grab colormap colors
      col_index = [(increment * c) for c in range(nclasses - 1)]
      col_index.append(1.0)
  
      # Create cmap list of colors
      cm = plt.cm.get_cmap(cmap)
  
      return [cm(c) for c in col_index]
  
file_path: earthpy/earthpy/plot.py
imports: import numpy
  import numpy.ma
  import matplotlib.pyplot
  from matplotlib import patches
  from matplotlib.colors import ListedColormap
  from mpl_toolkits.axes_grid1 import make_axes_locatable
  from skimage import exposure
  import earthpy.spatial
label_desc: Use image node_id 7 for calling a global function with example usage: make_col_list(unique_vals, nclasses, cmap) and returns: unknown