From df1925561a21fbac563df93502d11c3d3e4815d6 Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Fri, 12 Feb 2021 11:44:48 +0100
Subject: [PATCH] Improved visualizations of confusion matrix and
 classification report.

---
 pysegcnn/core/graphics.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py
index 586164e..7b410f1 100644
--- a/pysegcnn/core/graphics.py
+++ b/pysegcnn/core/graphics.py
@@ -430,6 +430,10 @@ def plot_confusion_matrix(cm, labels, normalize=True, figsize=(10, 10),
            ylabel='True',
            xlabel='Predicted')
 
+    # rotate x-tick labels
+    for label in ax.get_xticklabels():
+        label.set_rotation(90)
+
     # add colorbar axes
     cax = fig.add_axes([ax.get_position().x1 + 0.025, ax.get_position().y0,
                         0.05, ax.get_position().y1 - ax.get_position().y0])
@@ -739,7 +743,7 @@ def plot_classification_report(report, labels, figsize=(10, 10), **kwargs):
             color='white', lw=3)
 
     # set figure title
-    ax.set_title('Overall accuracy: {:.2f}'.format(overall_accuracy), pad=20)
+    ax.set_title('Accuracy: {:.2f}'.format(overall_accuracy), pad=20)
 
     return fig
 
-- 
GitLab