From 58855a2823c58234020ac4775cca5dae5e72de18 Mon Sep 17 00:00:00 2001 From: Chris Vasiladiotis Date: Fri, 8 Nov 2024 11:31:02 +0000 Subject: [PATCH] Fix legend and axis label positioning --- plots-cgo2025-ae/heatmap.py | 2 +- plots-cgo2025-ae/plot_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plots-cgo2025-ae/heatmap.py b/plots-cgo2025-ae/heatmap.py index d4858a9c..9f8b1744 100755 --- a/plots-cgo2025-ae/heatmap.py +++ b/plots-cgo2025-ae/heatmap.py @@ -115,7 +115,7 @@ def generate_heatmaps(data: pd.DataFrame): ax.set_xlabel("$N$") ax.set_ylabel("$K$", rotation=0) plt.yticks(rotation=0) - ax.yaxis.set_label_coords(-0.05, 0.95, transform=None) + ax.yaxis.set_label_coords(-0.1, 0.95, transform=None) ax.xaxis.set_label_coords(1, -0.05, transform=None) # Skip every second x-axis label diff --git a/plots-cgo2025-ae/plot_utils.py b/plots-cgo2025-ae/plot_utils.py index e03e8d43..1a1a378c 100644 --- a/plots-cgo2025-ae/plot_utils.py +++ b/plots-cgo2025-ae/plot_utils.py @@ -234,8 +234,8 @@ def plot_combined( for entry, (color, marker, linestyle) in legend_entries.items() ] labels = list(legend_entries.keys()) - fig.legend(lines, labels, ncols=legend_cols, bbox_to_anchor=(0.5, 1.03)) + fig.legend(lines, labels, ncols=legend_cols, bbox_to_anchor=(0.5, 1.0)) - fig.tight_layout() + fig.tight_layout(pad=2.5) return fig