code: def petals_plot(data1, data2, output_dir, name, pdf=True, offset=1):
      fig, axs = plt.subplots(1, 2)
  
      datas = [data1, data2]
      xlabels = ["Output sequence length", "Output sequence length"]
      ylabels = [
          "Full generation latency (s)",
          "Throughput per GPU (token/s)",
      ]
      xmins = [0, 0]
      legend = True
      for data, ax, xlabel, ylabel, xmin in zip(
          datas, axs, xlabels, ylabels, xmins
      ):
          petals_plot_common(
              data, ax, xlabel, ylabel, xmin, legend, offset=offset
          )
          legend = False
  
      fig.text(
          0.07, 0.5, "", va="center", rotation="vertical", fontsize=25
      )
  
      if pdf:
          output = os.path.join(output_dir, f"{name}.pdf")
      else:
          output = os.path.join(output_dir, f"{name}.png")
  
      figure_size = (18, 7)
      fig.set_size_inches(figure_size)
      fig.savefig(output, bbox_inches="tight")
      print(f"Output the plot to {output}")
  
file_path: H2O/h2o_flexgen/utils/plot_utils.py
imports: import matplotlib
  import matplotlib.pyplot
  import os
label_desc: Use image node_id 7 for calling a global function with example usage: petals_plot(data1, data2, output_dir, name, pdf, offset) without return types