From 8028a6b03855dc8a0196842f7f2b1c51c3f22c1b Mon Sep 17 00:00:00 2001 From: Tim Jammer <tim.jammer@tu-darmstadt.de> Date: Fri, 23 Aug 2024 15:43:56 +0200 Subject: [PATCH] added plots optimized for presentation on slides --- MBB.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/MBB.py b/MBB.py index 9be5f133..0a6a9927 100755 --- a/MBB.py +++ b/MBB.py @@ -1560,6 +1560,45 @@ def get_overview_plot(data, outpath,scrutiny="base"): plt.savefig(os.path.join(outpath, "overview_per_cat.pdf"), bbox_inches="tight") + # split plots in different pdfs + fig, ax = plt.subplots(figsize=(8, 4)) + df_p2p[["TP", "TN", "FP", "FN", "RE", "CE"]].plot.barh(stacked=True, ax=ax, legend=False, color=colors) + ax1.set_title('P2P') + handles, labels = ax.get_legend_handles_labels() + fig.legend(handles, labels, loc='upper center', ncols=1, bbox_to_anchor=(1.065, 0.9), ) + plt.tight_layout() + ax.set_yticklabels([label.get_text().upper() for label in ax.get_yticklabels()]) + plt.savefig(os.path.join(outpath, "overview_P2P.pdf"), bbox_inches="tight") + + fig, ax = plt.subplots(figsize=(8, 4)) + df_coll[["TP", "TN", "FP", "FN", "RE", "CE"]].plot.barh(stacked=True, ax=ax, legend=False, color=colors) + ax1.set_title('COLL') + handles, labels = ax.get_legend_handles_labels() + fig.legend(handles, labels, loc='upper center', ncols=1, bbox_to_anchor=(1.065, 0.9), ) + plt.tight_layout() + ax.set_yticklabels([label.get_text().upper() for label in ax.get_yticklabels()]) + plt.savefig(os.path.join(outpath, "overview_COLL.pdf"), bbox_inches="tight") + + fig, ax = plt.subplots(figsize=(8, 4)) + df_rma[["TP", "TN", "FP", "FN", "RE", "CE"]].plot.barh(stacked=True, ax=ax, legend=False, color=colors) + ax1.set_title('RMA') + handles, labels = ax.get_legend_handles_labels() + fig.legend(handles, labels, loc='upper center', ncols=1, bbox_to_anchor=(1.065, 0.9), ) + plt.tight_layout() + ax.set_yticklabels([label.get_text().upper() for label in ax.get_yticklabels()]) + plt.savefig(os.path.join(outpath, "overview_RMA.pdf"), bbox_inches="tight") + + fig, ax = plt.subplots(figsize=(8, 4)) + df_total[["TP", "TN", "FP", "FN", "RE", "CE"]].plot.barh(stacked=True, ax=ax, legend=False, color=colors) + ax1.set_title('ALL') + handles, labels = ax.get_legend_handles_labels() + fig.legend(handles, labels, loc='upper center', ncols=1, bbox_to_anchor=(1.065, 0.9), ) + plt.tight_layout() + ax.set_yticklabels([label.get_text().upper() for label in ax.get_yticklabels()]) + plt.savefig(os.path.join(outpath, "overview_ALL.pdf"), bbox_inches="tight") + + + ######################## # cmd_plots(): what to do when '-c plots' is used (extract the statistics of this tool) -- GitLab