| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #!/usr/bin/env python
- # a bar plot with errorbars
- import numpy as np
- import matplotlib.pyplot as plt
- cMeans=(0.00163314,0.0030878,0.00756769,0.0714377,1.13022)
- cStd=(0.000345353,0.000641013,0.00106808,0.00224826,0.0172249)
- asmMeans1=(0.00125512,0.00198333,0.00841489,0.0665831,1.15417)
- asmStd1=(0.000259477,0.000390865,0.000991933,0.00100535,0.0327828)
- asmMeans2=(0.00125345,0.0014143,0.00290749,0.0199608,0.389258)
- asmStd2=(0.000268301,0.000549018,0.000486762,0.00257161,0.0221019)
- #merge
- cMeans= (0.00124538,0.00128132,0.00121279,0.0030127,0.0205496)
- cStd= (0.000209686,0.000236924,0.000278824,0.000512202,0.0016461)
- asmMeans1= (0.0012121,0.00121418,0.00125287,0.00254286,0.0164427)
- asmStd1= (0.000191275,0.000190012,0.000139698,0.00044915,0.00159364)
- asmMeans2= (0.00119275,0.00130064,0.00114465,0.00240577,0.0149295)
- asmStd2= (0.000220732,0.000188047,0.000178148,0.000391202,0.00173487)
- tams = [ 1, 4, 16, 64, 1024 ]
- cMeans = tuple( i / tams[cMeans.index(i)] for i in cMeans)
- asmMeans1 = tuple( i / tams[asmMeans1.index(i)] for i in asmMeans1)
- asmMeans2 = tuple( i / tams[asmMeans2.index(i)] for i in asmMeans2)
- cStd = tuple( i / tams[cStd.index(i)] for i in cStd)
- asmStd1 = tuple( i / tams[asmStd1.index(i)] for i in asmStd1)
- asmStd2 = tuple( i / tams[asmStd2.index(i)] for i in asmStd2)
- n_groups = len(cMeans)
- fig, ax = plt.subplots()
- index = np.arange(n_groups)
- bar_width = 0.25
- opacity = 0.6
- error_config = {'ecolor': '0.3'}
- rects1 = plt.bar(index, cMeans, bar_width,
- alpha=opacity,
- color='b',
- yerr=cStd,
- error_kw=error_config,
- label='C')
- rects2 = plt.bar(index + bar_width, asmMeans1, bar_width,
- alpha=opacity,
- color='r',
- yerr=asmStd1,
- error_kw=error_config,
- label='ASM1')
- rects3 = plt.bar(index + 2*bar_width, asmMeans2, bar_width,
- alpha=opacity,
- color='g',
- yerr=asmStd2,
- error_kw=error_config,
- label='ASM2')
- plt.xlabel('Tamano')
- plt.ylabel('Tiempo')
- plt.title('Tiempo de ejecucion por pixel')
- plt.xticks(index + bar_width, (16,32,64,256,1024))
- plt.legend()
- plt.tight_layout()
- plt.show()
|