From a4a87f811fe166d6fb9e2b3f36789b70c6a8ab5f Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:57:15 -0400 Subject: [PATCH] Update glue/viewers/profile/state.py Co-authored-by: Derek Homeier --- glue/viewers/profile/state.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glue/viewers/profile/state.py b/glue/viewers/profile/state.py index 060dbe3ae..cafb59821 100644 --- a/glue/viewers/profile/state.py +++ b/glue/viewers/profile/state.py @@ -231,12 +231,12 @@ def _reset_y_limits(self, *event): self.y_min = y_min self.y_max = y_max elif np.allclose(y_min, y_max): - if np.allclose(y_min, 0): - self.y_min = -0.1 - self.y_max = 0.1 + if y_min == 0.0: + dy = np.finfo(y_min).resolution**2 else: - self.y_min = y_min * 0.9 - self.y_max = y_max * 1.1 + dy = abs(0.1 * y_min) + self.y_min = y_min - dy + self.y_max = y_max + dy else: self.y_min = 0 self.y_max = 1