code: def plot_map(matrix: np.ndarray):
      plt.figure()
  
      c_list = ["white", "blue", "red"]
      new_cmp = LinearSegmentedColormap.from_list("chaos", c_list)
      plt.imshow(matrix, cmap=new_cmp)
  
      ax = plt.gca()
      ax.set_xticks(np.arange(-0.5, matrix.shape[1], 1), minor=True)
      ax.set_yticks(np.arange(-0.5, matrix.shape[0], 1), minor=True)
  
      # 显示color bar
      plt.colorbar()
  
      # 在图中标注数量
      thresh = 5
      for x in range(matrix.shape[1]):
          for y in range(matrix.shape[0]):
              # 注意这里的matrix[y, x]不是matrix[x, y]
              info = int(matrix[y, x])
              ax.text(
                  x,
                  y,
                  info,
                  verticalalignment="center",
                  horizontalalignment="center",
                  color="white" if info > thresh else "black",
              )
      ax.grid(
          which="minor", color="black", linestyle="-", linewidth=1.5
      )
      plt.show()
      plt.close()
  
imports: import numpy
  import matplotlib.pyplot
  from matplotlib.colors import LinearSegmentedColormap
label_desc: Use image node_id 3 for calling a global function with example usage: plot_map(matrix) without return types