code: def makebarplot(rs, ps, outDir, class_name, iou_type):
      areaNames = ["allarea", "small", "medium", "large"]
      types = ["C75", "C50", "Loc", "Sim", "Oth", "BG", "FN"]
      fig, ax = plt.subplots()
      x = np.arange(len(areaNames))  # the areaNames locations
      width = 0.60  # the width of the bars
      rects_list = []
      figure_title = iou_type + "-" + class_name + "-" + "ap bar plot"
      for i in range(len(types) - 1):
          type_ps = ps[i, ..., 0]
          aps = [ps_.mean() for ps_ in type_ps.T]
          rects_list.append(
              ax.bar(
                  x - width / 2 + (i + 1) * width / len(types),
                  aps,
                  width / len(types),
                  label=types[i],
              )
          )
  
      # Add some text for labels, title and custom x-axis tick labels, etc.
      ax.set_ylabel("Mean Average Precision (mAP)")
      ax.set_title(figure_title)
      ax.set_xticks(x)
      ax.set_xticklabels(areaNames)
      ax.legend()
  
      # Add score texts over bars
      for rects in rects_list:
          autolabel(ax, rects)
  
      # Save plot
      fig.savefig(outDir + f"/{figure_title}.png")
      plt.close(fig)
  
file_path: mmdetection/tools/analysis_tools/coco_error_analysis.py
imports: import copy
  import os
  from argparse import ArgumentParser
  from multiprocessing import Pool
  import matplotlib.pyplot
  import numpy
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
label_desc: Use image node_id 3 for calling a global function with example usage: makebarplot(rs, ps, outDir, class_name, iou_type) without return types