| @@ -5,6 +5,7 @@ from argparse import ArgumentParser | |||
| from math import ceil | |||
| from time import sleep | |||
| import matplotlib | |||
| import pandas as pd | |||
| import matplotlib.pyplot as plt | |||
| from mpl_toolkits import axisartist | |||
| @@ -171,11 +172,26 @@ if __name__ == "__main__": | |||
| left_index=True, | |||
| ) | |||
| cc_algo = transmission_df["congestion_control"].iloc[0] | |||
| cc_algo = cc_algo.upper() | |||
| transmission_direction = transmission_df["direction"].iloc[0] | |||
| # transmission timeline | |||
| scaley = 1.5 | |||
| scalex = 1.0 | |||
| plt.figure(figsize=[6.4 * scaley, 4.8 * scalex]) | |||
| plt.title("{} with {}".format(transmission_direction, cc_algo)) | |||
| host = host_subplot(111, axes_class=axisartist.Axes) | |||
| cmap = matplotlib.cm.get_cmap("Set3") | |||
| for c in transmission_df["cellID"].unique(): | |||
| bounds = transmission_df[["cellID"]].groupby("color").agg(["min", "max"]).loc[c] | |||
| host.axvspan(bounds.min(), bounds.max() + 1, alpha=0.3, color=cmap.colors[c]) | |||
| plt.subplots_adjust() | |||
| # additional y axes | |||
| @@ -191,20 +207,17 @@ if __name__ == "__main__": | |||
| par12.axis["right"].toggle(all=True) | |||
| # par13.axis["right"].toggle(all=True) | |||
| host.plot(transmission_df["goodput"], "-", color="blue", label="goodput" ) | |||
| host.plot(transmission_df["goodput"], "-", color="blue", label="goodput") | |||
| host.set_xlabel("datetime") | |||
| host.set_ylabel("goodput [Mbps]") | |||
| #host.set_ylim([0, 13]) | |||
| #host.set_yscale("log") | |||
| #host.set_yscale("log") | |||
| #host.set_yscale("log") | |||
| #host.set_yscale("log") | |||
| par11.plot(transmission_df["downlink_cqi"], "--", color="green", label="CQI") | |||
| par11.set_ylabel("CQI") | |||
| par11.set_ylim([0, 15]) | |||
| par12.plot() | |||
| par12.plot(transmission_df["ach_rtt"], "-.", color="red", label="ACK RTT") | |||
| par12.set_ylabel("ACK RTT [s]") | |||
| par12.set_ylim([0, 5]) | |||
| if args.save: | |||
| plt.savefig("{}timeline_plot.pdf".format(args.save)) | |||
| @@ -218,7 +231,8 @@ if __name__ == "__main__": | |||
| plot_cdf(transmission_df, "goodput") | |||
| plt.xlabel("goodput [mbps]") | |||
| plt.ylabel("CDF") | |||
| plt.legend(["BBR"]) | |||
| plt.legend([cc_algo]) | |||
| plt.title("{} with {}".format(transmission_direction, cc_algo)) | |||
| if args.save: | |||
| plt.savefig("{}{}_cdf_plot.pdf".format(args.save, "goodput")) | |||
| @@ -232,7 +246,8 @@ if __name__ == "__main__": | |||
| plot_cdf(transmission_df, "ack_rtt") | |||
| plt.xlabel("ACK RTT [s]") | |||
| plt.ylabel("CDF") | |||
| plt.legend(["BBR"]) | |||
| plt.legend([cc_algo]) | |||
| plt.title("{} with {}".format(transmission_direction, cc_algo)) | |||
| if args.save: | |||
| plt.savefig("{}{}_cdf_plot.pdf".format(args.save, "ack_rtt")) | |||