From 3fe51e8fbf169cba7ef6258319d0caffe056e17c Mon Sep 17 00:00:00 2001 From: willGraham01 Date: Tue, 4 Feb 2025 13:03:15 +0000 Subject: [PATCH] Default units to pixels --- movement/plot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/movement/plot.py b/movement/plot.py index 80312a29..5f94d483 100644 --- a/movement/plot.py +++ b/movement/plot.py @@ -122,7 +122,8 @@ def occupancy_histogram( title = "Occupancy of " + ", ".join(title_components) if title: ax.set_title(title) - ax.set_xlabel(x_coord) - ax.set_ylabel(y_coord) + space_unit = data.attrs.get("space_unit", "pixels") + ax.set_xlabel(f"{x_coord} ({space_unit})") + ax.set_ylabel(f"{y_coord} ({space_unit})") return fig, ax, {"counts": counts, "xedges": xedges, "yedges": yedges}