-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_test_graph.py
50 lines (41 loc) · 1.18 KB
/
plot_test_graph.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
import matplotlib.pyplot as plt
import csv
x = []
y = []
with open('test_output_1.txt','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
for row in plots:
x.append(float(row[0]))
y.append(float(row[1]))
#print(x)
#print(y)
# plt.figure(dpi=150)
# plt.plot(x,y,label = "Function Curve")
# plt.scatter(x, y,label= "CGL Nodes", color= "red", marker= "*", s=10)
# plt.xlabel('Time')
# plt.ylabel('Amplitude')
# plt.title('Differentiation Matrix Validation')
# plt.legend()
# plt.savefig('Differentiation_Validation.png')
# plt.show()
a = []
b = []
with open('test_output_2.txt','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
for row in plots:
a.append(float(row[0]))
b.append(float(row[1]))
#print(x)
#print(y)
plt.figure(dpi=150)
plt.plot(x,y,label = "Function Curve")
# plt.hold(True);
plt.plot(a,b,label = "Derivative Curve")
plt.scatter(a, b,label= "CGL Nodes", color= "green", marker= "*", s=10)
plt.scatter(x, y,label= "CGL Nodes", color= "red", marker= "*", s=10)
plt.xlabel('Time')
plt.ylabel('Amplitude')
plt.title('Differentiation Matrix Validation')
plt.legend()
plt.savefig('Differentiation_Validation.png')
plt.show()