Skip to content

Commit cb18bba

Browse files
committed
Do not round to less than 2 digits to ensure retrocompatibility
1 parent 8b20941 commit cb18bba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

manim/mobject/graphing/number_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def get_tick_range(self) -> np.ndarray:
330330
x_max += 1e-6
331331

332332
# Handle cases where min and max are both positive or both negative
333-
if x_min < x_max < 0 or x_max > x_min >= 0:
333+
if x_min < x_max < 0 or x_max > x_min > 0:
334334
tick_range = np.arange(x_min, x_max, x_step)
335335
else:
336336
start_point = 0

manim/mobject/graphing/probability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def __init__(
281281

282282
elif len(y_range) == 2:
283283
y_step_target = max(self.values) / y_length
284-
y_range = [*y_range, round(y_step_target, int(np.ceil(-np.log10(y_step_target))))]
284+
y_range = [*y_range, round(y_step_target, max(2, int(np.ceil(-np.log10(y_step_target)))))]
285285

286286
if x_length is None:
287287
x_length = min(len(self.values), config.frame_width - 2)

0 commit comments

Comments
 (0)