Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py

Issue 1253473004: BWE Simulation Framework: Standard plot logging (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments addressed [2] Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py
diff --git a/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py b/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py
index f825be41fdc90665e8928b09bd1902894182f83a..63104d7866e25ffbeff686143c7a5f849eecb138 100644
--- a/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py
+++ b/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py
@@ -48,9 +48,13 @@ class Variable:
def addSample(self, line):
- groups = re.search(r'/\d_(\w+)#\d@(\w*)', line)
+ groups = re.search(r'_(((\d)+((,(\d)+)*))_(\D+))#\d@(\S+)', line)
+
+ # Each variable will be plotted in a separated box.
var_name = groups.group(1)
- alg_name = groups.group(2)
+ alg_name = groups.group(8)
+
+ alg_name = alg_name.replace('_', ' ')
if alg_name not in self._samples.keys():
self._samples[alg_name] = {}
@@ -59,6 +63,7 @@ class Variable:
self._samples[alg_name][var_name] = []
sample = re.search(r'(\d+\.\d+)\t([-]?\d+\.\d+)', line)
+
s = (sample.group(1),sample.group(2))
self._samples[alg_name][var_name].append(s)
@@ -86,19 +91,16 @@ def plotVar(v, ax, show_legend, show_x_label):
'NADA2':'#A0A0FF',
'NADA3':'#0000FF',
'NADA4':'#C0A0FF',
- 'NADA5':'#9060B0',
- 'TCP1':'#AAAAAA',
- 'TCP2':'#AAAAAA',
- 'TCP3':'#AAAAAA',
- 'TCP4':'#AAAAAA',
- 'TCP5':'#AAAAAA',
- 'TCP6':'#AAAAAA',
- 'TCP7':'#AAAAAA',
- 'TCP8':'#AAAAAA',
- 'TCP9':'#AAAAAA',
- 'TCP10':'#AAAAAA',}
-
- plt.setp(line, color=colormap[alg + str(i)])
+ 'NADA5':'#9060B0',}
+
+ key = alg + str(i)
+ if key in colormap:
+ plt.setp(line, color=colormap[key])
+ elif alg == 'TCP':
+ plt.setp(line, color='#AAAAAA')
+ else:
+ plt.setp(line, color='#654321')
+
if alg.startswith('Available'):
plt.setp(line, linestyle='--')
plt.grid(True)
@@ -110,8 +112,8 @@ def plotVar(v, ax, show_legend, show_x_label):
i += 1
if show_legend:
- legend = plt.legend(loc='upper right', shadow=True,
- fontsize='large', ncol=len(v._samples))
+ legend = plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.40),
+ shadow=True, fontsize='medium', ncol=len(v._samples))
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698