From 380b76404190a0edffa57a7e5906ecba7b457f23 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Tue, 28 Nov 2023 09:21:36 +0200 Subject: [PATCH] Return width 1 as fallback in flux.get_width() --- t3/utils/flux.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t3/utils/flux.py b/t3/utils/flux.py index 1bff73c7..34d932bc 100644 --- a/t3/utils/flux.py +++ b/t3/utils/flux.py @@ -694,6 +694,8 @@ def get_width(x: float, max_width, min_width = 4, 0.2 x, x_min, x_max = abs(x), abs(x_min), abs(x_max) if not log_scale: + if x == x_min == x_max: + return 1 return min_width + (x - x_min) * (max_width - min_width) / (x_max - x_min) return get_width(x=-np.log10(x_min) - np.log10(x_max) + np.log10(x), x_min=-np.log10(x_max),