From 897c7a0c41c7c83b61ca0fd000a2d7be8072f275 Mon Sep 17 00:00:00 2001
From: Tooba Ali <alit1@myumanitoba.ca>
Date: Wed, 19 Apr 2023 20:09:42 +0000
Subject: [PATCH] define y_limits in truth_reconstruction.py for text location
 on plots

---
 benchmarks/dis/analysis/truth_reconstruction.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/benchmarks/dis/analysis/truth_reconstruction.py b/benchmarks/dis/analysis/truth_reconstruction.py
index e2363ed9..b6555c7e 100644
--- a/benchmarks/dis/analysis/truth_reconstruction.py
+++ b/benchmarks/dis/analysis/truth_reconstruction.py
@@ -398,6 +398,7 @@ def particle_plots(boolean_particle):
     ax2.errorbar(-Y_error[1][0], Y_error[1][1], yerr=Y_error[1][3], xerr=Y_error[1][2] ,fmt='None', ecolor = 'orange', elinewidth = 1)
     ax3.errorbar(-Y_error[0][0], Y_error[0][1], yerr=Y_error[0][3], xerr=Y_error[0][2] ,fmt='None', ecolor = 'orange', elinewidth = 1)
     ax4.errorbar(-Y_error[1][0], Y_error[1][1], yerr=Y_error[1][3], xerr=Y_error[1][2] ,fmt='None', ecolor = 'orange', elinewidth = 1)
+    y_limits = ax3.get_ylim()
     for each_bin in range(len(Y_error[0][0])):
         if not np.isnan(Y_error[0][1][each_bin]):
             ax3.text(x=-Y_error[0][0][each_bin]-0.1,y=y_limits[1] - Y_error[0][4]*10,
-- 
GitLab