code: def draw_anytime_result(
      result_dir,
      y_acc_list_arr,
      x_T_list,
      x_acc_train,
      y_acc_train_l,
      y_acc_train_m,
      y_acc_train_h,
      annotations,
      lv,
      name_img,
      dataset,
      x1_lim=[],
      x2_lim=[],
  ):
      fig, (ax1, ax2) = plt.subplots(
          2,
          1,
          sharex=True,
          dpi=100,
          gridspec_kw={"height_ratios": [4, 1]},
      )
      exp = np.array(y_acc_list_arr)
      sys_acc_h = np.quantile(exp, 0.75, axis=0)
      sys_acc_m = np.quantile(exp, 0.5, axis=0)
      sys_acc_l = np.quantile(exp, 0.25, axis=0)
  
      # plot simulate result of system
      ax1.fill_between(x_T_list, sys_acc_l, sys_acc_h, alpha=0.1)
      ax1.plot(x_T_list, sys_acc_m, mark_list[-1], label="TRAILS")
      ax2.fill_between(x_T_list, sys_acc_l, sys_acc_h, alpha=0.1)
  
      # plot simulate result of train-based line
      ax1.fill_between(
          x_acc_train, y_acc_train_l, y_acc_train_h, alpha=0.3
      )
      ax1.plot(
          x_acc_train,
          y_acc_train_m,
          mark_list[-2],
          label="Training-based MS",
      )
      ax2.fill_between(
          x_acc_train, y_acc_train_l, y_acc_train_h, alpha=0.3
      )
  
      for i in range(len(annotations)):
          ele = annotations[i]
          if ele[1] < lv:
              # convert to mins
              ax2.plot(
                  ele[2] / 60,
                  ele[1],
                  mark_list[i],
                  label=ele[0],
                  fontsize=set_marker_size,
              )
          else:
              ax1.plot(
                  ele[2] / 60,
                  ele[1],
                  mark_list[i],
                  label=ele[0],
                  fontsize=set_marker_size,
              )
          # ax2.scatter(ele[2]/60, ele[1]* 0.01, s=100, color="red")
          # ax2.annotate(ele[0], (ele[2]/60, ele[1] * 0.01))
  
      if len(x1_lim) > 0 and len(x2_lim) > 0:
          ax1.set_ylim(x1_lim[0], x1_lim[1])  # 子图1设置y轴范围，只显示部分图
          ax2.set_ylim(x2_lim[0], x2_lim[1])  # 子图2设置y轴范围，只显示部分图
  
      ax1.spines["bottom"].set_visible(False)  # 关闭子图1中底部脊
      ax2.spines["top"].set_visible(False)  ##关闭子图2中顶部脊
      ax2.set_xticks(range(0, 31, 1))
  
      d = 0.85  # 设置倾斜度
      # 绘制断裂处的标记
      kwargs = dict(
          marker=[(-1, -d), (1, d)],
          markersize=set_marker_size,
          linestyle="none",
          color="r",
          mec="r",
          mew=1,
          clip_on=False,
      )
      ax1.plot([0, 1], [0, 0], transform=ax1.transAxes, **kwargs)
      ax2.plot([0, 1], [1, 1], transform=ax2.transAxes, **kwargs)
  
      plt.tight_layout()
      plt.xscale("symlog")
      ax1.grid()
      ax2.grid()
      plt.xlabel(
          "Time Budget given by user (min)", fontsize=set_font_size
      )
      ax1.set_ylabel(
          f"Test accuracy on {dataset}", fontsize=set_font_size
      )
      ax1.legend(ncol=1, fontsize=set_lgend_size)
      ax2.legend(fontsize=set_lgend_size)
      # plt.show()
      plt.savefig(
          f"{result_dir}/any_time_{name_img}.pdf", bbox_inches="tight"
      )
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/exps/draw_img_lib.py
imports: import os
  from matplotlib import pyplot
  import seaborn
  import numpy
  import palettable
  from matplotlib.ticker import MaxNLocator
  import numpy
  from src.common.constant import Config
  import matplotlib
label_desc: Use image node_id 2 for calling a global function with example usage: draw_anytime_result(result_dir, y_acc_list_arr, x_T_list, x_acc_train, y_acc_train_l, y_acc_train_m, y_acc_train_h, annotations, lv, name_img, dataset, x1_lim, x2_lim) without return types