-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscatter_plot.py
More file actions
88 lines (74 loc) · 3.22 KB
/
scatter_plot.py
File metadata and controls
88 lines (74 loc) · 3.22 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import matplotlib.pyplot as plt
def plot(s, sy, sx, l=False):
file1 = open(s, "r")
allLines = file1.readlines()
xlist = [0.0]
ylist = [0.0]
for line in allLines:
xy = line.split()
xlist.append(float(xy[0]))
ylist.append(float(xy[1]))
if(l):
plt.plot(xlist, ylist)
else:
plt.scatter(xlist, ylist)
plt.title(s)
plt.ylabel(sy)
plt.xlabel(sx)
plt.savefig(s+"_figure.png")
plt.clf()
def q9(s, sy, sx):
file1 = open(s+"_seq", "r")
allLines = file1.readlines()
xlist = []
ylist = []
for line in allLines:
xy = line.split()
xlist.append(float(xy[0]))
ylist.append(float(xy[1]))
plt.scatter(xlist, ylist, s=200, facecolors='none', edgecolors='r')
file1.close()
file1 = open(s+"_ack", "r")
allLines = file1.readlines()
xlist = []
ylist = []
for line in allLines:
xy = line.split()
xlist.append(float(xy[0]))
ylist.append(float(xy[1]))
plt.scatter(xlist, ylist, s=15, facecolors='none', edgecolors='g')
plt.title(s)
plt.ylabel(sy)
plt.xlabel(sx)
plt.savefig(s+"_figure.png")
plt.clf()
# plot('file1.csv_q4', 'P(Conn. Dur)<X', 'Connection Duration')
# plot('file2.csv_q4', 'P(Conn. Dur)<X', 'Connection Duration')
# plot('file3.csv_q4', 'P(Conn. Dur)<X', 'Connection Duration')
# plot('file1.csv_q5_send_vs_time', 'Incoming(Server) data size', 'Duration of conn.')
# plot('file2.csv_q5_send_vs_time', 'Incoming(Server) data size', 'Duration of conn.')
# plot('file3.csv_q5_send_vs_time', 'Incoming(Server) data size', 'Duration of conn.')
# plot('file1.csv_q5_send_vs_recv', 'Incoming(Server) data size', 'Outgoing(Server) data size')
# plot('file2.csv_q5_send_vs_recv', 'Incoming(Server) data size', 'Outgoing(Server) data size')
# plot('file3.csv_q5_send_vs_recv', 'Incoming(Server) data size', 'Outgoing(Server) data size')
# plot('file1.csv_q6', 'P(Inter-arr time)<X', 'Inter Arrival Time(Connection)')
# plot('file2.csv_q6', 'P(Inter-arr time)<X', 'Inter Arrival Time(Connection)')
# plot('file3.csv_q6', 'P(Inter-arr time)<X', 'Inter Arrival Time(Connection)')
# plot('file1.csv_q7', 'P(Inter-arr time)<X', 'Inter Arrival Time(Packets)')
# plot('file2.csv_q7', 'P(Inter-arr time)<X', 'Inter Arrival Time(Packets)')
# plot('file3.csv_q7', 'P(Inter-arr time)<X', 'Inter Arrival Time(Packets)')
# plot('file1.csv_q8_send', 'P(Packet length)<X', 'Incoming(Server) Packet length')
# plot('file2.csv_q8_send', 'P(Packet length)<X', 'Incoming(Server) Packet length')
# plot('file3.csv_q8_send', 'P(Packet length)<X', 'Incoming(Server) Packet length')
# plot('file1.csv_q8_recv', 'P(Packet length)<X', 'Outgoing(Server) Packet length')
# plot('file2.csv_q8_recv', 'P(Packet length)<X', 'Outgoing(Server) Packet length')
# plot('file3.csv_q8_recv', 'P(Packet length)<X', 'Outgoing(Server) Packet length')
# plot('file1.csv_q11_avg_queue_size', 'Avg Queue Size', 'Rho', True)
# plot('file2.csv_q11_avg_queue_size', 'Avg Queue Size', 'Rho', True)
# plot('file3.csv_q11_avg_queue_size', 'Avg Queue Size', 'Rho', True)
# plot('file1.csv_q11_avg_waiting_time', 'Avg Waiting Time', 'Rho', True)
# plot('file2.csv_q11_avg_waiting_time', 'Avg Waiting Time', 'Rho', True)
# plot('file3.csv_q11_avg_waiting_time', 'Avg Waiting Time', 'Rho', True)
q9('file1.csv_q9', 'Number', 'Time')
q9('file2.csv_q9', 'Number', 'Time')
q9('file3.csv_q9', 'Number', 'Time')