code: def display_grid_plot(
      list_of_captions, list_of_images, max_columns=4, figsize=(20, 20)
  ):
      """
      Function to display grid of images and their titles/captions.
      """
  
      # load list of images
      masked_images = []
      for filename in list_of_images:
          image = load_image(filename)
          masked_images.append(image.astype(int))
  
      # display grid plot with wrapping
      fig = plt.figure(figsize=figsize)
      column = 0
      for i in range(len(masked_images)):
          column += 1
          #  check for end of column and create a new figure
          if column == max_columns + 1:
              fig = plt.figure(figsize=figsize)
              column = 1
          fig.add_subplot(1, max_columns, column)
          plt.imshow(masked_images[i])
          plt.axis("off")
          if len(list_of_captions) >= len(masked_images):
              plt.title(
                  "\n".join(wrap(str(list_of_captions[i]), width=40))
              )
  
file_path: shap/shap/utils/image.py
imports: import os
  from textwrap import wrap
  import cv2
  import matplotlib.pyplot
  import numpy
  import shap
label_desc: Use image node_id 8 for calling a global function with example usage: display_grid_plot(list_of_captions, list_of_images, max_columns, figsize) without return types