code: def plot_to_file(report, filename):
      global fignum
      fignum += 1
      pylab.figure(fignum)
  
      run_to_label = {
          "stl": "C++ STL",
          "thrust": "Thrust",
          "compute": "Boost.Compute",
          "bolt": "Bolt",
      }
  
      for run in sorted(report.samples.keys()):
          x = []
          y = []
  
          for sample in report.samples[run]:
              x.append(sample[0])
              y.append(sample[1])
  
          pylab.loglog(x, y, marker="o", label=run_to_label[run])
  
      pylab.xlabel("Size")
      pylab.ylabel("Time (ms)")
      pylab.legend(loc="upper left")
      pylab.savefig(filename)
  
imports: import os
  import sys
  import pylab
  from perf import run_benchmark
label_desc: Use image node_id 1 for calling a global function with example usage: plot_to_file(report, filename) without return types