Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fix bug where ~.NumberLine.add_labels() cannot accept non-mobject labels. (#2043)

Laith Bahodi209474a2f346
diff --git a/manim/mobject/number_line.py b/manim/mobject/number_line.py
index a8b2d569c..ecf637124 100644
--- a/manim/mobject/number_line.py
+++ b/manim/mobject/number_line.py
@@ -397,11 +397,11 @@ class NumberLine(Line):
labels = VGroup()
for x, label in dict_values.items():
+ label = self.create_label_tex(label)
if hasattr(label, "font_size"):
label.font_size = font_size
else:
raise AttributeError(f"{label} is not compatible with add_labels.")
- label = self.create_label_tex(label)
label.next_to(self.number_to_point(x), direction=direction, buff=buff)
labels.add(label)