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 63104d7866e25ffbeff686143c7a5f849eecb138..a37d95479a86c71f462d5e3ebff7464016fa392b 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py |
+++ b/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py |
@@ -73,27 +73,32 @@ def plotVar(v, ax, show_legend, show_x_label): |
ax.set_ylabel(v.getYLabel(), fontsize='large') |
for alg in v._samples.keys(): |
- i = 1 |
+ |
for series in v._samples[alg].keys(): |
+ |
x = [sample[0] for sample in v._samples[alg][series]] |
y = [sample[1] for sample in v._samples[alg][series]] |
x = numpy.array(x) |
y = numpy.array(y) |
+ |
line = plt.plot(x, y, label=alg, linewidth=4.0) |
- colormap = {'Available1':'#AAAAAA', |
- 'Available2':'#AAAAAA', |
- 'GCC1':'#80D000', |
- 'GCC2':'#008000', |
- 'GCC3':'#00F000', |
- 'GCC4':'#00B000', |
- 'GCC5':'#70B020', |
- 'NADA1':'#0000AA', |
- 'NADA2':'#A0A0FF', |
- 'NADA3':'#0000FF', |
- 'NADA4':'#C0A0FF', |
- 'NADA5':'#9060B0',} |
- |
- key = alg + str(i) |
+ |
+ colormap = {'Available0':'#AAAAAA', |
+ 'Available1':'#AAAAAA', |
+ 'GCC0':'#80D000', |
+ 'GCC1':'#008000', |
+ 'GCC2':'#00F000', |
+ 'GCC3':'#00B000', |
+ 'GCC4':'#70B020', |
+ 'NADA0':'#0000AA', |
+ 'NADA1':'#A0A0FF', |
+ 'NADA2':'#0000FF', |
+ 'NADA3':'#C0A0FF', |
+ 'NADA4':'#9060B0',} |
+ |
+ flow_id = re.search(r'(\d+(,\d+)*)', series) # One or multiple ids. |
+ key = alg + flow_id.group(1) |
+ |
if key in colormap: |
plt.setp(line, color=colormap[key]) |
elif alg == 'TCP': |
@@ -109,11 +114,10 @@ def plotVar(v, ax, show_legend, show_x_label): |
if v.getYMax() >= 0: |
y2 = v.getYMax() |
plt.axis((0, x2, 0, y2)) |
- i += 1 |
if show_legend: |
legend = plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.40), |
- shadow=True, fontsize='medium', ncol=len(v._samples)) |
+ shadow=True, fontsize='large', ncol=len(v._samples)) |
if __name__ == '__main__': |
@@ -121,6 +125,8 @@ if __name__ == '__main__': |
('Throughput_kbps', "Time (s)", "Throughput (kbps)", 1, 4000), |
('Delay_ms', "Time (s)", "One-way Delay (ms)", 2, 500), |
('Packet_Loss', "Time (s)", "Packet Loss Ratio", 3, 1.0), |
+ # ('Sending_Estimate_kbps', "Time (s)", "Sending Estimate (kbps)", |
+ # 4, 4000), |
] |
var = [] |
@@ -138,7 +144,7 @@ if __name__ == '__main__': |
if v.getID() in line: |
v.addSample(line) |
- matplotlib.rcParams.update({'font.size': 20}) |
+ matplotlib.rcParams.update({'font.size': 48/len(variables)}) |
# Plot variables. |
fig = plt.figure() |