From cb18bbacaef55252b7eb5e9cfcd512ff156e2a08 Mon Sep 17 00:00:00 2001 From: zeFresk <8807862+zeFresk@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:09:08 +0200 Subject: [PATCH] Do not round to less than 2 digits to ensure retrocompatibility --- manim/mobject/graphing/number_line.py | 2 +- manim/mobject/graphing/probability.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manim/mobject/graphing/number_line.py b/manim/mobject/graphing/number_line.py index b99972ad64..efb95ae399 100644 --- a/manim/mobject/graphing/number_line.py +++ b/manim/mobject/graphing/number_line.py @@ -330,7 +330,7 @@ def get_tick_range(self) -> np.ndarray: x_max += 1e-6 # Handle cases where min and max are both positive or both negative - if x_min < x_max < 0 or x_max > x_min >= 0: + if x_min < x_max < 0 or x_max > x_min > 0: tick_range = np.arange(x_min, x_max, x_step) else: start_point = 0 diff --git a/manim/mobject/graphing/probability.py b/manim/mobject/graphing/probability.py index d1f960d9c7..ef6415b2ea 100644 --- a/manim/mobject/graphing/probability.py +++ b/manim/mobject/graphing/probability.py @@ -281,7 +281,7 @@ def __init__( elif len(y_range) == 2: y_step_target = max(self.values) / y_length - y_range = [*y_range, round(y_step_target, int(np.ceil(-np.log10(y_step_target))))] + y_range = [*y_range, round(y_step_target, max(2, int(np.ceil(-np.log10(y_step_target)))))] if x_length is None: x_length = min(len(self.values), config.frame_width - 2)