Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add an option to not display zero by default

Grant Sanderson312e9c460be3
diff --git a/manimlib/mobject/number_line.py b/manimlib/mobject/number_line.py
index c60b620e4..cf5d1e92c 100644
--- a/manimlib/mobject/number_line.py
+++ b/manimlib/mobject/number_line.py
@@ -1,7 +1,6 @@
import operator as op
from manimlib.constants import *
-from manimlib.mobject.geometry import RegularPolygon
from manimlib.mobject.geometry import Line
from manimlib.mobject.numbers import DecimalNumber
from manimlib.mobject.types.vectorized_mobject import VGroup
@@ -128,7 +127,7 @@ class NumberLine(Line):
def default_numbers_to_display(self):
if self.numbers_to_show is not None:
return self.numbers_to_show
- numbers = np.arange(int(self.leftmost_tick), int(self.x_max) + 1)
+ numbers = np.arange(int(self.leftmost_tick), int(self.x_max))
if self.exclude_zero_from_default_numbers:
numbers = numbers[numbers != 0]
return numbers
@@ -173,17 +172,6 @@ class NumberLine(Line):
self.add(self.numbers)
return self
- # def add_tip(self):
- # tip = RegularPolygon(3)
- # color = self.color
- # tip.set_stroke(color, width=self.get_stroke_width())
- # tip.set_fill(color, opacity=1)
- # tip.set_width(self.tip_width)
- # tip.set_height(self.tip_height, stretch=True)
- # tip.move_to(self.get_end(), LEFT)
- # self.tip = tip
- # self.add(tip)
-
class UnitInterval(NumberLine):
CONFIG = {