code: def plot_common(data, ax, xlabel, xmin, ytick, title, legend=True):
      methods = list(data.keys())
      methods.sort(key=lambda x: method2order(x))
  
      curves = []
      legends = []
      y_max = 0
      for i, method in enumerate(methods):
          curve = data[method]
          xs_, ys_ = zip(*curve.items())
          xy = sorted(zip(xs_, ys_))
          xs_ = [x for x, _ in xy]
          ys_ = [y for _, y in xy]
          xs = []
          ys = []
          for x, y in zip(xs_, ys_):
              if len(xs) == 0 or y >= ys[-1]:
                  xs.append(x)
                  ys.append(y)
  
          # print(method)
          # print(xs)
          # print(ys)
  
          curve = ax.plot(
              xs,
              ys,
              color=method2color(method),
              marker="*",
              linestyle=method2style(method),
              linewidth=4,
              markersize=20,
          )
          curves.append(curve[0])
          legends.append(method.replace("HuggingFace", "Accelerate"))
  
          y_max = max(y_max, *ys)
  
      ax.tick_params(axis="both", which="major", labelsize=20)
      ax.tick_params(axis="both", which="minor", labelsize=20)
      ax.set_xlabel(xlabel, fontsize=25)
      ax.set_xscale("log", base=2)
      ax.set_yscale("log", base=2)
      ax.set_xlim(xmin=xmin)
      ax.set_yticks(ytick)
      ax.set_title(title, fontsize=25)
  
      # if "175B" in title:
      #    ax.text(2 ** 10, 2**-7, title, fontsize=25)
      # elif "30B" in title:
      #    ax.text(2 ** 9, 2**-2, title, fontsize=25)
  
      ax.grid()
  
      if legend:
          ax.legend(
              curves,
              legends,
              fontsize=25,
              loc="upper center",
              bbox_to_anchor=(1.09, 1.25),
              ncol=4,
          )
  
file_path: H2O/h2o_flexgen/utils/plot_utils.py
imports: import matplotlib
  import matplotlib.pyplot
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: plot_common(data, ax, xlabel, xmin, ytick, title, legend) without return types