code: def plot_bands(
      arr,
      cmap="Greys_r",
      figsize=(12, 12),
      cols=3,
      title=None,
      extent=None,
      cbar=True,
      scale=False,
      vmin=None,
      vmax=None,
      ax=None,
      alpha=1,
      norm=None,
  ):
      """Plot each band in a numpy array in its own axis.
  
      Assumes band order (band, row, col).
  
      Parameters
      ----------
      arr : numpy array
          An n-dimensional numpy array to plot.
      cmap : str (default = "Greys_r")
          Colormap name for plots.
      figsize : tuple (default = (12, 12))
          Figure size in inches.
      cols : int (default = 3)
          Number of columns for plot grid.
      title : str or list (optional)
          Title of one band or list of titles with one title per band.
      extent : tuple (optional)
          Bounding box that the data will fill: (minx, miny, maxx, maxy).
      cbar : Boolean (default = True)
          Turn off colorbar if needed.
      scale : Boolean (Default = False)
          Turn off bytescale scaling if needed.
      vmin : Int (Optional)
          Specify the vmin to scale imshow() plots.
      vmax : Int (Optional)
          Specify the vmax to scale imshow() plots.
      alpha : float (optional)
          The alpha value for the plot. This will help adjust the transparency
          of the plot to the desired level.
      norm : matplotlib Normalize object (Optional)
          The normalized boundaries for custom values coloring. NOTE: For this
          argument to work, the scale argument MUST be set to false. Because
          of this, the function will automatically set scale to false,
          even if the user manually sets scale to true.
  
      Returns
      ----------
      ax or axs : matplotlib.axes._subplots.AxesSubplot object(s)
          The axes object(s) associated with the plot.
  
      Example
      -------
      .. plot::
  
          >>> import matplotlib.pyplot as plt
          >>> import earthpy.plot as ep
          >>> from earthpy.io import path_to_example
          >>> import rasterio as rio
          >>> titles = ['Red', 'Green', 'Blue']
          >>> with rio.open(path_to_example('rmnp-rgb.tif')) as src:
          ...     ep.plot_bands(src.read(),
          ...                   title=titles,
          ...                   figsize=(8, 3))
          array([<Axes: title={'center': 'Red'}>...
      """
      show = False
      try:
          arr.ndim
      except AttributeError:
          raise AttributeError("Input arr should be a numpy array")
      if norm:
          scale = False
      if title:
          if isinstance(title, str):
              title = [title]
  
          # A 2-dim array should only be passed one title
          if arr.ndim == 2 and len(title) > 1:
              raise ValueError(
                  "plot_bands expects one title for a single "
                  "band array. You have provided more than one title."
              )
          # A 3 dim array should have the same number of titles as dims
          if arr.ndim > 2:
              if len(title) != arr.shape[0]:
                  raise ValueError(
                      "plot_bands expects the number of plot titles "
                      "to equal the number of array raster layers."
                  )
  
      # If the array is 3 dimensional setup grid plotting
      if arr.ndim > 2 and arr.shape[0] > 1:
          # Calculate the total rows that will be required to plot each band
          plot_rows = int(np.ceil(arr.shape[0] / cols))
          total_layers = arr.shape[0]
  
          # Plot all bands
          fig, axs = plt.subplots(plot_rows, cols, figsize=figsize)
          axs_ravel = axs.ravel()
          for ax, i in zip(axs_ravel, range(total_layers)):
              band = i + 1
  
              arr_im = arr[i]
  
              if title:
                  the_title = title[i]
              else:
                  the_title = "Band {}".format(band)
  
              _plot_image(
                  arr_im,
                  cmap=cmap,
                  cbar=cbar,
                  scale=scale,
                  vmin=vmin,
                  vmax=vmax,
                  extent=extent,
                  title=the_title,
                  ax=ax,
                  alpha=alpha,
                  norm=norm,
              )
          # This loop clears out the plots for axes which are empty
          # A matplotlib axis grid is always uniform with x cols and x rows
          # eg: an 8 band plot with 3 cols will always be 3 x 3
          for ax in axs_ravel[total_layers:]:
              ax.set_axis_off()
              ax.set(xticks=[], yticks=[])
          plt.tight_layout()
          plt.show()
          return axs
  
      elif arr.ndim == 2 or arr.shape[0] == 1:
          # If it's a 2 dimensional array with a 3rd dimension
          arr = np.squeeze(arr)
  
          if ax is None:
              fig, ax = plt.subplots(figsize=figsize)
              show = True
  
          if title:
              title = title[0]
  
          _plot_image(
              arr,
              cmap=cmap,
              scale=scale,
              cbar=cbar,
              vmin=vmin,
              vmax=vmax,
              extent=extent,
              title=title,
              ax=ax,
              alpha=alpha,
              norm=norm,
          )
          if show:
              plt.show()
          return ax
  
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 3 for calling a global function with example usage: plot_bands(arr, cmap, figsize, cols, title, extent, cbar, scale, vmin, vmax, ax, alpha, norm) and returns: axs, ax