Guest User

Untitled

a guest
Oct 22nd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import re
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. import sys
  5. import itertools
  6. import subprocess
  7.  
  8.  
  9. data = [b for b in [re.split("\s+", i.strip('\n')) for i in open('40000_output.txt')] if len(b) > 1]
  10. final_data = [[int(re.sub("\w+_", '', a)), int(b)] for a, b in data]
  11.  
  12.  
  13. # VISUALIZATION
  14.  
  15. # Transpose the data to get the x and y values
  16. labels, values = zip(*final_data)
  17.  
  18. # from the number of the length
  19. indexes = np.arange(len(labels))
  20. width = 1
  21.  
  22. plt.xlabel("Execution Attempt")
  23. plt.ylabel("Time to Completion (Nanosecond)")
  24.  
  25. plt.bar(indexes, values, width)
  26. plt.xticks(indexes + width * 0.5, labels)
  27. plt.show()
Add Comment
Please, Sign In to add comment