-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotopt.py
42 lines (36 loc) · 1.35 KB
/
plotopt.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 matplotlib.pyplot as plt
import numpy as np
plt.switch_backend('agg')
data = [
[1000, 10, 0.9998352715083713],
[1000, 20, 0.9999244136040342],
[1000, 50, 0.9999692776339557],
[2000, 10, 0.9998231591930655],
[2000, 20, 0.9999494930518706],
[2000, 50, 0.9999844344970188],
[4000, 10, 0.9999500906337729],
[4000, 20, 0.9999107758362972],
[4000, 50, 0.9999831333875866],
[8000, 10, 0.9999908671002634],
[8000, 20, 0.9999643078714204],
[8000, 50, 0.9999887215294413],
[16000, 10, 0.9999448855962229],
[16000, 20, 0.999994247473523],
[16000, 50, 0.9999936966569895],
[32000, 10, 0.9999732694886106],
[32000, 20, 0.9999947437152163],
[32000, 50, 0.9999989820124024],
[64000, 10, 0.9999522241169538],
[64000, 20, 0.9999795483110671],
[64000, 50, 0.9999990035996933]
]
data1 = np.array([ [x[0],x[2]] for x in data if x[1] == 10])
data2 = np.array([ [x[0],x[2]] for x in data if x[1] == 20])
data3 = np.array([ [x[0],x[2]] for x in data if x[1] == 50])
plt.semilogx(data1[:, 0], data1[:, 1], marker='.', markersize=10, label=r"$M$ = 10")
plt.semilogx(data2[:, 0], data2[:, 1], marker='.', markersize=10, label=r"$M$ = 20")
plt.semilogx(data3[:, 0], data3[:, 1], marker='.', markersize=10, label=r"$M$ = 50")
plt.ylim((0.9998 , 1))
plt.grid(True)
plt.legend()
plt.savefig("opt.png", dpi=1200)