class_docstr: 注意，如果显示的图像不全，是matplotlib版本问题
  本例程使用matplotlib-3.2.1(windows and ubuntu)绘制正常
  需要额外安装prettytable库
class_docstr_tok: ["\u6ce8\u610f\uff0c\u5982\u679c\u663e\u793a\u7684\u56fe\u50cf\u4e0d\u5168\uff0c\u662fmatplotlib\u7248\u672c\u95ee\u9898","\u672c\u4f8b\u7a0b\u4f7f\u7528matplotlib-3.2.1","(","windows","and","ubuntu",")","\u7ed8\u5236\u6b63\u5e38","\u9700\u8981\u989d\u5916\u5b89\u88c5prettytable\u5e93"]
code: def plot(self):
      matrix = self.matrix
      print(matrix)
      plt.imshow(matrix, cmap=plt.cm.Blues)
  
      # 设置x轴坐标label
      plt.xticks(range(self.num_classes), self.labels, rotation=45)
      # 设置y轴坐标label
      plt.yticks(range(self.num_classes), self.labels)
      # 显示colorbar
      plt.colorbar()
      plt.xlabel("True Labels")
      plt.ylabel("Predicted Labels")
      plt.title("Confusion matrix")
  
      # 在图中标注数量/概率信息
      thresh = matrix.max() / 2
      for x in range(self.num_classes):
          for y in range(self.num_classes):
              # 注意这里的matrix[y, x]不是matrix[x, y]
              info = int(matrix[y, x])
              plt.text(
                  x,
                  y,
                  info,
                  verticalalignment="center",
                  horizontalalignment="center",
                  color="white" if info > thresh else "black",
              )
      plt.tight_layout()
      plt.show()
  
file_path: deep-learning-for-image-processing/pytorch_classification/swin_transformer/create_confusion_matrix.py
imports: import os
  import json
  import argparse
  import sys
  import torch
  from torchvision import transforms
  import numpy
  from tqdm import tqdm
  import matplotlib.pyplot
  from prettytable import PrettyTable
  from utils import read_split_data
  from my_dataset import MyDataSet
  from model import swin_base_patch4_window12_384_in22k
label_desc: Use image node_id 4 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.plot() without return types