Skip to content

Commit 457cbb3

Browse files
committed
removed first timestamps but should be possible as an option instead
1 parent a22d076 commit 457cbb3

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

mptcpanalyzer/plots/dsn.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def plot(self, dat, mptcpstream, field=None, **kwargs):
5454
)
5555

5656
axes.set_xlabel("Time (s)")
57-
axes.set_ylabel(self.mptcp_attributes[field])
57+
axes.set_ylabel(self._attributes[field])
5858

5959
handles, labels = axes.get_legend_handles_labels()
6060

@@ -92,37 +92,41 @@ def __init__(self, *args, **kwargs):
9292
# # help="Choose an mptcp attribute to plot")
9393
# return parser
9494

95-
def plot(self, dat, tcpstream, field=None, **kwargs):
95+
def plot(self, df, tcpstream, field=None, **kwargs):
9696
"""
9797
getcallargs
9898
"""
9999
fig = plt.figure()
100100
# tcpstreams = dat.groupby('tcpstream')
101101

102-
print("%d streams in the MPTCP flow" % len(tcpstream))
102+
# print("%d streams in the MPTCP flow" % len(tcpstream))
103103
print("Plotting field %s" % field)
104104

105105
axes = fig.gca()
106106

107107
# for idx, (streamid, ds) in enumerate(tcpstreams):
108-
ds[field].plot.line(
109-
ax=axes,
110-
# use_index=False,
111-
legend=False,
112-
grid=True,
113-
)
108+
tcpdf = df[df.tcpstream == tcpstream]
109+
110+
# TODO le .iloc permet d'eliminer les syn/ack
111+
tcpdf[field].iloc[3:].plot.line(
112+
ax=axes,
113+
# use_index=False,
114+
legend=False,
115+
grid=True,
116+
)
114117

115118
axes.set_xlabel("Time (s)")
116-
axes.set_ylabel(self.attributes[field])
119+
axes.set_ylabel(self._attributes[field])
117120

118121
handles, labels = axes.get_legend_handles_labels()
119122

123+
print(tcpdf[field].iloc[3:])
120124
# Generate "subflow X" labels
121125
# location: 3 => bottom left, 4 => bottom right
122-
axes.legend(
123-
handles,
124-
["%s for Subflow %d" % (field, x) for x, _ in enumerate(labels)],
125-
loc=4
126-
)
126+
# axes.legend(
127+
# handles,
128+
# ["%s for Subflow %d" % (field, x) for x, _ in enumerate(labels)],
129+
# loc=4
130+
# )
127131

128132
return fig

0 commit comments

Comments
 (0)