plotter.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/usr/bin/env python
  2. # a bar plot with errorbars
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. cMeans=(0.00163314,0.0030878,0.00756769,0.0714377,1.13022)
  6. cStd=(0.000345353,0.000641013,0.00106808,0.00224826,0.0172249)
  7. asmMeans1=(0.00125512,0.00198333,0.00841489,0.0665831,1.15417)
  8. asmStd1=(0.000259477,0.000390865,0.000991933,0.00100535,0.0327828)
  9. asmMeans2=(0.00125345,0.0014143,0.00290749,0.0199608,0.389258)
  10. asmStd2=(0.000268301,0.000549018,0.000486762,0.00257161,0.0221019)
  11. #merge
  12. cMeans= (0.00124538,0.00128132,0.00121279,0.0030127,0.0205496)
  13. cStd= (0.000209686,0.000236924,0.000278824,0.000512202,0.0016461)
  14. asmMeans1= (0.0012121,0.00121418,0.00125287,0.00254286,0.0164427)
  15. asmStd1= (0.000191275,0.000190012,0.000139698,0.00044915,0.00159364)
  16. asmMeans2= (0.00119275,0.00130064,0.00114465,0.00240577,0.0149295)
  17. asmStd2= (0.000220732,0.000188047,0.000178148,0.000391202,0.00173487)
  18. tams = [ 1, 4, 16, 64, 1024 ]
  19. cMeans = tuple( i / tams[cMeans.index(i)] for i in cMeans)
  20. asmMeans1 = tuple( i / tams[asmMeans1.index(i)] for i in asmMeans1)
  21. asmMeans2 = tuple( i / tams[asmMeans2.index(i)] for i in asmMeans2)
  22. cStd = tuple( i / tams[cStd.index(i)] for i in cStd)
  23. asmStd1 = tuple( i / tams[asmStd1.index(i)] for i in asmStd1)
  24. asmStd2 = tuple( i / tams[asmStd2.index(i)] for i in asmStd2)
  25. n_groups = len(cMeans)
  26. fig, ax = plt.subplots()
  27. index = np.arange(n_groups)
  28. bar_width = 0.25
  29. opacity = 0.6
  30. error_config = {'ecolor': '0.3'}
  31. rects1 = plt.bar(index, cMeans, bar_width,
  32. alpha=opacity,
  33. color='b',
  34. yerr=cStd,
  35. error_kw=error_config,
  36. label='C')
  37. rects2 = plt.bar(index + bar_width, asmMeans1, bar_width,
  38. alpha=opacity,
  39. color='r',
  40. yerr=asmStd1,
  41. error_kw=error_config,
  42. label='ASM1')
  43. rects3 = plt.bar(index + 2*bar_width, asmMeans2, bar_width,
  44. alpha=opacity,
  45. color='g',
  46. yerr=asmStd2,
  47. error_kw=error_config,
  48. label='ASM2')
  49. plt.xlabel('Tamano')
  50. plt.ylabel('Tiempo')
  51. plt.title('Tiempo de ejecucion por pixel')
  52. plt.xticks(index + bar_width, (16,32,64,256,1024))
  53. plt.legend()
  54. plt.tight_layout()
  55. plt.show()