Skip to content
Snippets Groups Projects
Commit 55ff138b authored by Jammer, Tim's avatar Jammer, Tim
Browse files

updated plot script

parent af93a348
Branches
No related tags found
1 merge request!20Parsing and tools updates
...@@ -10,15 +10,35 @@ sns.set_theme() ...@@ -10,15 +10,35 @@ sns.set_theme()
sns.set_style("whitegrid") sns.set_style("whitegrid")
# input path # input path
input_path = "/home/tim/TEMP/mpi-bugbench-results/logs-20240606/csv" input_path = "/home/tim/mpi-bugbench/logs/mpi-bugbench-results/logs-20240723-151721/csv"
# output path # output path
plot_path = "/home/tim/paper/2024_eurompi_mpi-bugbench-paper/media" plot_path = "/home/tim/paper/2024_eurompi_mpi-bugbench-paper/media"
df_coll = pd.read_csv(os.path.join(input_path, "COLL.csv"), index_col=0) df_itac= pd.read_csv(os.path.join(input_path, "itac_base.csv"), index_col=0)
df_other = pd.read_csv(os.path.join(input_path, "other.csv"), index_col=0) df_parcoach= pd.read_csv(os.path.join(input_path, "parcoach_base.csv"), index_col=0)
df_p2p = pd.read_csv(os.path.join(input_path, "P2P.csv"), index_col=0) df_must= pd.read_csv(os.path.join(input_path, "must_base.csv"), index_col=0)
df_rma = pd.read_csv(os.path.join(input_path, "RMA.csv"), index_col=0)
df_total = pd.read_csv(os.path.join(input_path, "total.csv"), index_col=0)
df_coll= pd.DataFrame(columns=df_itac.columns)
df_coll.loc["MUST"] = df_must.loc["COLL"]
df_coll.loc["ITAC"] = df_itac.loc["COLL"]
df_coll.loc["PARCOACH"] = df_parcoach.loc["COLL"]
df_p2p= pd.DataFrame(columns=df_itac.columns)
df_p2p.loc["MUST"] = df_must.loc["P2P"]
df_p2p.loc["ITAC"] = df_itac.loc["P2P"]
df_p2p.loc["PARCOACH"] = df_parcoach.loc["P2P"]
df_rma= pd.DataFrame(columns=df_itac.columns)
df_rma.loc["MUST"] = df_must.loc["RMA"]
df_rma.loc["ITAC"] = df_itac.loc["RMA"]
df_rma.loc["PARCOACH"] = df_parcoach.loc["RMA"]
df_total= pd.DataFrame(columns=df_itac.columns)
df_total.loc["MUST"] = df_must.loc["ALL"]
df_total.loc["ITAC"] = df_itac.loc["ALL"]
df_total.loc["PARCOACH"] = df_parcoach.loc["ALL"]
SMALL_SIZE = 20 SMALL_SIZE = 20
MEDIUM_SIZE = 22 MEDIUM_SIZE = 22
...@@ -34,23 +54,23 @@ plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title ...@@ -34,23 +54,23 @@ plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title
fig, axs = plt.subplots(nrows=2, ncols=2, figsize=(16, 9)) # fig, axs = plt.subplots(nrows=2, ncols=2, figsize=(16, 9)) #
colors = ['#228833', '#66ccee', '#ee6677', '#aa3377', '#937860', '#ccbb44', '#bbbbbb'] colors = ['#228833', '#66ccee', '#ee6677', '#aa3377', '#bbbbbb']
((ax1, ax2), (ax3, ax4)) = axs ((ax1, ax2), (ax3, ax4)) = axs
df_p2p[["TP", "TN", "FP", "FN", "TO", "RE", "CE"]].plot.barh(stacked=True, ax=ax1, legend=False, color=colors) df_p2p[["TP", "TN", "FP", "FN", "CE"]].plot.barh(stacked=True, ax=ax1, legend=False, color=colors)
ax1.set_title('P2P') ax1.set_title('P2P')
handles, labels = ax1.get_legend_handles_labels() handles, labels = ax1.get_legend_handles_labels()
df_coll[["TP", "TN", "FP", "FN", "TO", "RE", "CE"]].plot.barh(stacked=True, ax=ax2, legend=False, color=colors) df_coll[["TP", "TN", "FP", "FN", "CE"]].plot.barh(stacked=True, ax=ax2, legend=False, color=colors)
ax2.set_title('Collective') ax2.set_title('Collective')
ax2.yaxis.tick_right() ax2.yaxis.tick_right()
# Set the y-axis labels to uppercase # Set the y-axis labels to uppercase
ax2.set_yticklabels([label.get_text().upper() for label in ax2.get_yticklabels()]) ax2.set_yticklabels([label.get_text().upper() for label in ax2.get_yticklabels()])
df_rma[["TP", "TN", "FP", "FN", "TO", "RE", "CE"]].plot.barh(stacked=True, ax=ax3, legend=False, color=colors) df_rma[["TP", "TN", "FP", "FN", "CE"]].plot.barh(stacked=True, ax=ax3, legend=False, color=colors)
ax3.set_title('RMA') ax3.set_title('RMA')
df_total[["TP", "TN", "FP", "FN", "TO", "RE", "CE"]].plot.barh(stacked=True, ax=ax4, legend=False, color=colors) df_total[["TP", "TN", "FP", "FN", "CE"]].plot.barh(stacked=True, ax=ax4, legend=False, color=colors)
ax4.set_title('Total') ax4.set_title('Total')
ax4.yaxis.tick_right() ax4.yaxis.tick_right()
...@@ -59,7 +79,7 @@ for ax in [ax1, ax2, ax3, ax4]: ...@@ -59,7 +79,7 @@ for ax in [ax1, ax2, ax3, ax4]:
# Set the y-axis labels to uppercase # Set the y-axis labels to uppercase
ax.set_yticklabels([label.get_text().upper() for label in ax.get_yticklabels()]) ax.set_yticklabels([label.get_text().upper() for label in ax.get_yticklabels()])
fig.legend(handles, labels, loc='upper center', ncols=4, bbox_to_anchor=(0.5, 1.1), ) fig.legend(handles, labels, loc='upper center', ncols=5, bbox_to_anchor=(0.5, 1.05), )
plt.tight_layout() plt.tight_layout()
plt.savefig(os.path.join(plot_path, "results_per_cat.pdf"), bbox_inches="tight") plt.savefig(os.path.join(plot_path, "results_per_cat.pdf"), bbox_inches="tight")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment