github.com/DARA-Project/GoDist-Scheduler@v0.0.0-20201030134746-668de4acea0d/macro-benchmarks/plot_minference.py (about)

     1  import matplotlib.pyplot as plt
     2  import numpy as np
     3  import pandas as pd
     4  import sys
     5  import os
     6  
     7  def line_plot(name, xdata, ydata, xlabel, ylabel, figsize):
     8      fig = plt.figure(figsize=figsize)
     9      ax = fig.add_subplot(111)
    10      ax.plot(xdata, ydata, marker="o")
    11      ax.set_xlabel(xlabel)
    12      ax.set_ylabel(ylabel)
    13      plt.savefig(name + ".png", bbox_inches="tight")
    14  
    15  def main():
    16      xdata = [20, 72, 137, 302, 658, 1152]
    17      ydata = [123, 153, 138, 173, 233, 259]
    18      line_plot("Model_Inference", xdata, ydata, "Number of Events", "Runtime (in ms)", (8,4))
    19  
    20  if __name__ == '__main__':
    21      main()