-
Notifications
You must be signed in to change notification settings - Fork 2
/
plot_div.py
42 lines (37 loc) · 1.31 KB
/
plot_div.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
import numpy as np
from matplotlib import pyplot as plt
names = ['LEMON', 'Muffin-Chain', 'Muffin-Cell', 'Luo-WS', 'Luo-RN', 'GenCoG-M']
paths = [
'out/lemon.txt',
'out/muffin-dag.txt',
'out/muffin-template.txt',
'out/graphfuzz-ws.txt',
'out/graphfuzz-rn.txt',
'out/gencog-muffin.txt'
]
colors = ['deeppink', 'tab:purple', 'dodgerblue', 'tab:cyan', 'tab:green', 'darkorange']
assert len(names) == len(paths), len(names) == len(colors)
data = [np.loadtxt(p) for p in paths]
plt.rc('font', family='Latin Modern Sans', size=12)
plt.figure(figsize=(6, 4))
plt.gca().set_box_aspect(3 / 5)
for i in range(len(names)):
plt.plot(data[i][:, 0], data[i][:, 1], color=colors[i], linewidth=2, label=names[i])
plt.ylim(0, 0.6)
plt.ticklabel_format(axis='x', style='sci', scilimits=(0, 0))
plt.xlabel('#Vertices')
plt.ylabel('Vertex Diversity')
plt.legend(ncol=2)
plt.savefig('out/vert-div.pdf')
plt.show()
plt.figure(figsize=(6, 4))
plt.gca().set_box_aspect(3 / 5)
for i in range(len(names)):
plt.plot(data[i][:, 0], data[i][:, 2], color=colors[i], linewidth=2, label=names[i])
plt.ticklabel_format(axis='x', style='sci', scilimits=(0, 0))
plt.ylim(0, 0.85)
plt.xlabel('#Vertices')
plt.ylabel('Edge Diversity')
plt.legend(ncol=2, loc='lower right', bbox_to_anchor=(1, 0.07))
plt.savefig('out/edge-div.pdf')
plt.show()