Skip to content

Commit

Permalink
Do not round to less than 2 digits to ensure retrocompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
zeFresk committed Sep 15, 2024
1 parent 8b20941 commit cb18bba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manim/mobject/graphing/number_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion manim/mobject/graphing/probability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cb18bba

Please sign in to comment.