-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfigure9.py
More file actions
35 lines (29 loc) · 1.23 KB
/
figure9.py
File metadata and controls
35 lines (29 loc) · 1.23 KB
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
import sys
import os
import matplotlib.ticker as mtick
sys.path.append(os.path.dirname(__file__))
from utils import *
from plot_utils import *
plt.rcParams["font.family"] = "Times New Roman"
plt.rcParams.update({'font.size': FONT_SIZE})
plt.rcParams["figure.figsize"] = (6, 4.3)
plt.rcParams['axes.xmargin'] = 0
plt.rcParams['axes.ymargin'] = 0
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
df = pd.read_csv(RESULTS_DIR + f"/figure9.csv")
fig, ax = plt.subplots()
sc1 = plt.scatter(x=rand_jitter(df["sparsity_raw"]), y=df["required_storage_pct"], alpha=0.5, color='deepskyblue', s=1, label="Sparse Register Tiling")
sc2 = plt.scatter(x=rand_jitter(df["sparsity_raw"]), y=df["csr_required_storage_pct"], alpha=0.5, color='firebrick', s=1, label='CSR')
lgnd = plt.legend(handles=[sc1, sc2], loc='upper right')
lgnd.legend_handles[0]._sizes = [50]
lgnd.legend_handles[1]._sizes = [50]
ax.spines.right.set_visible(False)
ax.spines.top.set_visible(False)
ax.xaxis.set_major_formatter(mtick.PercentFormatter(xmax=1.0, decimals=0))
ax.yaxis.set_major_formatter(mtick.PercentFormatter(xmax=1.0, decimals=0))
plt.ylabel('Required Storage (pct of dense)')
plt.xlabel('Sparsity')
plt.margins(x=0)
plt.tight_layout()
savefig("figure9.pdf")