-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_e2e.py
139 lines (110 loc) · 3.14 KB
/
plot_e2e.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import seaborn as sns
import pandas
import matplotlib.pyplot as plt
sns.set(font_scale=2)
sns.set_style("ticks")
# sns.set_theme(style="whitegrid")
data = pandas.read_csv("e2e.csv")
print(data.head())
# print(data["app"][0])
palette = sns.color_palette("pastel")
color1 = palette[0]
color2 = palette[1]
color3 = palette[2]
hatch1 = ""
hatch2 = "\\"
hatch3 = "*"
hatch_list = [hatch1, hatch2, hatch3]
palette_console = [color2, color1, color3]
# palette_console = [color2, color1, color3, palette[3], palette[4], palette[5], palette[6]]
g = sns.catplot(
data=data, kind="bar",
x="app", y="throughput", hue="platform",
errorbar="sd", palette=palette_console, alpha=.8,
edgecolor='black',
linewidth=1,
aspect=3.8,
# aspect=1.2,
width=0.5,
# height=5,
legend=True
)
# add pattern
for bars, hatch in zip(g.ax.containers, hatch_list):
for bar in bars:
bar.set_hatch(hatch)
ax = g.facet_axis(0, 0)
# ax.set_ylim(top=3)
def get_num(num):
if num >= 10:
return int(num)
else:
return "{:.2f}".format(num)
ax.legend()
# # iterate through the axes containers
# for c in ax.containers:
# labels = [f'{get_num(v.get_height())}' for v in c]
# # labels = [f'{int(v.get_height())}' for v in c]
# ax.bar_label(c, labels=labels, label_type='edge')
ax.relim()
ax.autoscale_view()
ax.margins(x=0.001)
# FONT_SIZE = 14
# xytext = (80,240)
ax.annotate(
# "Lower is better ↓",
"Higher is better ↑",
xycoords="axes points",
xy=(600, 242),
# xytext=xytext,
#xytext=(-100, -27),
# fontsize=FONT_SIZE,
color="navy",
weight="bold",
)
g.despine(right=False, top=False, offset={'top':1.5})
# g.tight_layout()
g.set_axis_labels("", "Throughput [MiB/s]")
# g.legend.set_title("Platform")
def add_line(ax, xpos, ypos):
line = plt.Line2D([xpos, xpos], [ypos+0.1, ypos], transform=ax.transAxes, color='black')
line.set_clip_on(False)
ax.add_line(line)
add_line(ax, 0, -.1)
add_line(ax, 0, -.2)
add_line(ax, 0, -.3)
# add_line(ax, 0, -.4)
add_line(ax, 8/16, -.1)
add_line(ax, 8/16, -.2)
add_line(ax, 8/16, -.3)
# add_line(ax, 8/16, -.4)
add_line(ax, 1, -.1)
add_line(ax, 1, -.2)
add_line(ax, 1, -.3)
# add_line(ax, 1, -.4)
ax.annotate('Memory benchmarks',
xycoords="figure points",
xy=(450, 18),
# xytext=(-10, 90),
# textcoords='offset points',
horizontalalignment='center', verticalalignment='bottom')
# plt.text(-0.4, -0.6, "Vitis Accel examples")
ax.annotate('RDMA benchmarks',
xycoords="figure points",
xy=(1200, 18),
# xytext=(-10, 90),
# textcoords='offset points',
horizontalalignment='center', verticalalignment='bottom')
# ax.legend()
g.legend.remove()
plt.legend(loc='lower left')
ax.patch.set_edgecolor('black')
plt.tight_layout()
plt.yscale('log')
# plt.xticks(rotation=15)
plt.ylim(top=2000)
# sns.move_legend(g, "lower left", bbox_to_anchor=(.55, .45), title='Platform')
# g.fig.subplots_adjust(top=0.92, wspace = 0.1)
# g.fig.suptitle('Isolation overhead')
g.savefig("e2e.png", bbox_inches='tight')
g.savefig("e2e.pdf", bbox_inches='tight')