From bd963ba7075670303ead271c7b34d3d2e79cdf49 Mon Sep 17 00:00:00 2001 From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu> Date: Fri, 29 Jan 2021 17:36:25 +0100 Subject: [PATCH] Updated plot annotations and legend position. --- pysegcnn/core/graphics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py index 368208c..3f2bfdb 100644 --- a/pysegcnn/core/graphics.py +++ b/pysegcnn/core/graphics.py @@ -642,7 +642,9 @@ def plot_class_distribution(ds, figsize=(16, 9), alpha=0.5): art.set_alpha(alpha) # add name of the spectral band to the plot - ax.text(x=0.6, y=0.95, s='({})'.format(ds.use_bands[band]), + ax.text(x=0.6, y=0.95, s='({}: {})'.format( + getattr(ds.sensor, ds.use_bands[band]).value, + getattr(ds.sensor, ds.use_bands[band]).name), ha='left', va='top', weight='bold') # create a patch (proxy artist) for every class @@ -650,7 +652,8 @@ def plot_class_distribution(ds, figsize=(16, 9), alpha=0.5): npix_per_class.items()] # add legend with number of pixels per class to plot - axes[-1].legend(handles=patches, loc=2, frameon=False) + axes[-1].legend(handles=patches, loc='upper right', frameon=False, + bbox_to_anchor=(-0.15, -0.15), ncol=len(labels)) # adjust space between subplots fig.subplots_adjust(hspace=0.075, wspace=0.025) -- GitLab