Explorar el Código

Adds fancy legend.

master
Lukas Prause hace 2 años
padre
commit
70a1e5b82e
Se han modificado 1 ficheros con 17 adiciones y 11 borrados
  1. +17
    -11
      plot_single_transmission_EM9190.py

+ 17
- 11
plot_single_transmission_EM9190.py Ver fichero

@@ -10,6 +10,7 @@ import pandas as pd
import matplotlib.pyplot as plt

import seaborn as sns

sns.set()

tex_fonts = {
@@ -25,6 +26,7 @@ tex_fonts = {
"mathtext.fontset": "dejavusans",
}


# plt.rcParams.update(tex_fonts)


@@ -89,7 +91,7 @@ if __name__ == "__main__":
transmission_df = transmission_df.sort_index()

# srtt to [s]
transmission_df["srtt"] = transmission_df["srtt"].apply(lambda x: x / 10**6)
transmission_df["srtt"] = transmission_df["srtt"].apply(lambda x: x / 10 ** 6)

# key for columns and level for index
transmission_df["goodput"] = (
@@ -98,14 +100,14 @@ if __name__ == "__main__":
.transform("sum")
)
transmission_df["goodput"] = transmission_df["goodput"].apply(
lambda x: ((x * 8) / args.interval) / 10**6
lambda x: ((x * 8) / args.interval) / 10 ** 6
)

transmission_df["goodput_rolling"] = (
transmission_df["payload_size"].rolling("{}s".format(args.interval)).sum()
)
transmission_df["goodput_rolling"] = transmission_df["goodput_rolling"].apply(
lambda x: ((x * 8) / args.interval) / 10**6
lambda x: ((x * 8) / args.interval) / 10 ** 6
)

# set meta values and remove all not needed columns
@@ -171,14 +173,15 @@ if __name__ == "__main__":
].fillna(0)

transmission_df["lte_effective_bw_sum"] = (
transmission_df["LTE_SCC1_effective_bw"].fillna(0)
+ transmission_df["LTE_SCC2_effective_bw"].fillna(0)
+ transmission_df["LTE_SCC3_effective_bw"].fillna(0)
+ transmission_df["LTE_SCC4_effective_bw"].fillna(0)
+ transmission_df["LTE_bw"].fillna(0))
transmission_df["LTE_SCC1_effective_bw"].fillna(0)
+ transmission_df["LTE_SCC2_effective_bw"].fillna(0)
+ transmission_df["LTE_SCC3_effective_bw"].fillna(0)
+ transmission_df["LTE_SCC4_effective_bw"].fillna(0)
+ transmission_df["LTE_bw"].fillna(0))
transmission_df["nr_effective_bw_sum"] = transmission_df["SCC1_NR5G_effective_bw"]

transmission_df["effective_bw_sum"] = transmission_df["nr_effective_bw_sum"] + transmission_df["lte_effective_bw_sum"]
transmission_df["effective_bw_sum"] = transmission_df["nr_effective_bw_sum"] + transmission_df[
"lte_effective_bw_sum"]

# transmission timeline
scaley = 1.5
@@ -309,21 +312,24 @@ if __name__ == "__main__":
ax01.set_ylabel("Bandwidth [MHz]")

if args.fancy:
ax0.set_xlim([0, transmission_df.index[-1]])
ax00.set_xlim([0, transmission_df.index[-1]])
# added these three lines
lns_ax0 = snd_plot + srtt_plot + goodput_plot
labs_ax0 = [l.get_label() for l in lns_ax0]
ax0.legend(lns_ax0, labs_ax0, ncols=4, fontsize=12, loc="upper center")

lns_ax00 = eff_bw_plot + lte_eff_bw_plot + nr_eff_bw_plot + lte_rsrq_plot + nr_rsrq_plot
if lte_hanover_plot:
lns_ax00.append(lte_hanover_plot)
if nr_hanover_plot:
lns_ax00.append(nr_hanover_plot)
labs_ax00 = [l.get_label() for l in lns_ax0]
labs_ax00 = [l.get_label() for l in labs_ax00]
ax00.legend(lns_ax00, labs_ax00, ncols=4, fontsize=12, loc="upper center")
plt.savefig("{}{}_plot.eps".format(args.save, csv.replace(".csv", "")), bbox_inches="tight")
else:
fig.legend(loc="lower right")
plt.savefig("{}{}_plot.pdf".format(args.save, csv.replace(".csv", "")), bbox_inches="tight")
plt.savefig("{}{}_plot.pdf".format(args.save, csv.replace(".csv", "")), bbox_inches="tight")
# except Exception as e:
# print("Error processing file: {}".format(csv))
# print(str(e))

Cargando…
Cancelar
Guardar