exjobb-public/plots/shyloc_results.py

38 lines
1.3 KiB
Python

import matplotlib.pyplot as plt
import numpy as np
text_size = 30
stroke = 2
marker_width = 8
packet_sizes = (4,8,16,32,64,128)
configs = {
'Single Issue' : (0.4239, 0.4380, 0.4377, 0.4368, 0.4350, 0.4313),
'Performance Optimized' : (0.4228, 0.4379, 0.4378, 0.4371, 0.4353, 0.4292),
'Resource Utilization Optimized': (0.4239, 0.4380, 0.4385, 0.4371, 0.4353, 0.4293),
}
x = np.arange(len(packet_sizes)) # the label locations
ys = np.arange(0,3,0.125)
width = 0.25 # the width of the bars
multiplier = 0
fig, ax = plt.subplots(layout='constrained')
for attribute, measurement in configs.items():
offset = width * multiplier
rects = ax.bar(x + offset, measurement, width, label=attribute)
##ax.bar_label(rects, padding=15+multiplier*40,fontsize=text_size)
multiplier += 1
plt.plot([-0.125,5.625],[0.4419,0.4419],lw=stroke)
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Throughput (B/C)',fontsize=text_size)
ax.set_xlabel('Packet Size (B/P)',fontsize=text_size)
ax.set_title('Throughput during SHyLoC compression (1904B uncompressed, 1664B compressed)',fontsize=text_size)
ax.set_xticks(x + width, packet_sizes,fontsize=text_size)
ax.set_yticks(ys, ys,fontsize=text_size)
ax.legend(loc='upper left', ncols=2,fontsize=text_size)
ax.set_ylim(0, 1)
plt.show()