-
Notifications
You must be signed in to change notification settings - Fork 0
/
sfp.py
38 lines (27 loc) · 811 Bytes
/
sfp.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
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime as dt
from matplotlib.dates import DateFormatter
with open('./fpidentityall.txt') as f:
fidelityls = []
for s in f.readlines():
datals = s.strip().split()
fidelityls.append(float(datals[0]))
fig = plt.figure()
x = np.arange(len(fidelityls))
y = np.array(fidelityls)
ax1 = fig.add_subplot(1, 1, 1)
ax1.plot(x, y, label='identity')
with open('./fpusedmoqall.txt') as f:
fidelityls = []
for s in f.readlines():
datals = s.strip().split()
fidelityls.append(float(datals[0]))
x = np.arange(len(fidelityls))
y = np.array(fidelityls)
ax1.plot(x, y, label='usedmoq')
plt.ylabel("fidelity")
plt.xlabel("iteration time")
plt.legend(loc='lower right')
# plt.yscale('log')
plt.show()