diff --git a/Plotting.py b/Plotting.py index 2059f880581255d7815947fcf587f55d5cd8588a..7afc200d5fb9fd507fc53550d3693dd21a30a161 100644 --- a/Plotting.py +++ b/Plotting.py @@ -279,7 +279,7 @@ def plot_classification_accuracy(evaluation_dict: dict, colors: dict) -> None: pos = np.arange(len(model_names)) width = 1/(3*len(model_names)) fig = plt.figure('classification_accuracy') - ax = fig.add_axes([0.15, 0.3, 0.75, 0.6]) + ax = fig.add_axes([0.15, 0.3, 0.6, 0.6]) step_len = 1 adjustment = -(len(model_names)//2)*step_len for measure in evaluation_dict: @@ -295,7 +295,8 @@ def plot_classification_accuracy(evaluation_dict: dict, colors: dict) -> None: ax.set_ylim(bottom=-0.02) ax.set_ylim(top=1.02) ax.set_title('Classification Evaluation (Barplot)') - ax.legend(loc='upper right') + ax.legend(loc='center right', bbox_to_anchor=(1.4, 0.75), shadow=True, + ncol=1, fancybox=True, fontsize=8) def plot_boxplot(evaluation_dict: dict, colors: dict) -> None: @@ -314,7 +315,7 @@ def plot_boxplot(evaluation_dict: dict, colors: dict) -> None: model_names = evaluation_dict[list(colors.keys())[0]].keys() font_size = 16 - (len(max(model_names, key=len))//3) fig = plt.figure('boxplot_accuracy') - ax = fig.add_axes([0.15, 0.3, 0.75, 0.6]) + ax = fig.add_axes([0.15, 0.3, 0.6, 0.6]) step_len = 1.5 boxplots = [] adjustment = -(len(model_names)//2)*step_len @@ -339,4 +340,5 @@ def plot_boxplot(evaluation_dict: dict, colors: dict) -> None: ax.set_ylabel('Classification (%)') ax.set_title('Classification Evaluation (Boxplot)') ax.legend([bp["boxes"][0] for bp in boxplots], evaluation_dict.keys(), - loc='upper right') + loc='center right', bbox_to_anchor=(1.4, 0.75), shadow=True, + ncol=1, fancybox=True, fontsize=8)