@@ -54,7 +54,7 @@ def plot(self, dat, mptcpstream, field=None, **kwargs):
54
54
)
55
55
56
56
axes .set_xlabel ("Time (s)" )
57
- axes .set_ylabel (self .mptcp_attributes [field ])
57
+ axes .set_ylabel (self ._attributes [field ])
58
58
59
59
handles , labels = axes .get_legend_handles_labels ()
60
60
@@ -92,37 +92,41 @@ def __init__(self, *args, **kwargs):
92
92
# # help="Choose an mptcp attribute to plot")
93
93
# return parser
94
94
95
- def plot (self , dat , tcpstream , field = None , ** kwargs ):
95
+ def plot (self , df , tcpstream , field = None , ** kwargs ):
96
96
"""
97
97
getcallargs
98
98
"""
99
99
fig = plt .figure ()
100
100
# tcpstreams = dat.groupby('tcpstream')
101
101
102
- print ("%d streams in the MPTCP flow" % len (tcpstream ))
102
+ # print("%d streams in the MPTCP flow" % len(tcpstream))
103
103
print ("Plotting field %s" % field )
104
104
105
105
axes = fig .gca ()
106
106
107
107
# 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
+ )
114
117
115
118
axes .set_xlabel ("Time (s)" )
116
- axes .set_ylabel (self .attributes [field ])
119
+ axes .set_ylabel (self ._attributes [field ])
117
120
118
121
handles , labels = axes .get_legend_handles_labels ()
119
122
123
+ print (tcpdf [field ].iloc [3 :])
120
124
# Generate "subflow X" labels
121
125
# 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
+ # )
127
131
128
132
return fig
0 commit comments