From 386d198950e551c11677e3f865f7c081007d8b28 Mon Sep 17 00:00:00 2001
From: Tom Greig <tag2y19@soton.ac.uk>
Date: Thu, 7 Dec 2023 12:05:25 +0000
Subject: [PATCH] Place axis labels properly

They're now relative to the axis, not the drawing area's edge
---
 src/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 091ec4f..b6093ee 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1371,7 +1371,7 @@ static void plot_draw( GtkDrawingArea* plot,
 			&xlab_w, &xlab_h );
 		cairo_move_to( cr,
 			m[1] + ( width - m[1] - m[3] ) / 2 - xlab_w / 2,
-			height - xlab_h - 3 );
+			height - m[0] + margin_reqs[0] - xlab_h - 3 );
 		pango_cairo_show_layout( cr, context->xlab_layout );
 	}
 
@@ -1383,7 +1383,7 @@ static void plot_draw( GtkDrawingArea* plot,
 		pango_layout_get_pixel_size( context->yllab_layout,
 			&yllab_w, NULL );
 		cairo_move_to( cr,
-			3,
+			m[1] - margin_reqs[1] + 3,
 			m[2] + ( height - m[2] - m[0] ) / 2 + yllab_w / 2 );
 		cairo_rotate( cr, - M_PI / 2 );
 		pango_cairo_show_layout( cr, context->yllab_layout );
@@ -1397,7 +1397,7 @@ static void plot_draw( GtkDrawingArea* plot,
 		pango_layout_get_pixel_size( context->yrlab_layout,
 			&yrlab_w, NULL );
 		cairo_move_to( cr,
-			width - 3,
+			width - m[3] + margin_reqs[3] + 5,
 			m[2] + ( height - m[2] - m[0] ) / 2 - yrlab_w / 2 );
 		cairo_rotate( cr, M_PI / 2 );
 		pango_cairo_show_layout( cr, context->yrlab_layout );
-- 
GitLab