Merge pull request #469 from ggarza/master

Fix alignment of minus sign to numbers
This commit is contained in:
Grant Sanderson
2019-03-08 16:56:11 -08:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@ -62,7 +62,8 @@ class DecimalNumber(VMobject):
# to the bottom
for i, c in enumerate(num_string):
if c == "-" and len(num_string) > i + 1:
self[i].align_to(self[i + 1], alignment_vect=UP)
self[i].align_to(self[i + 1], UP)
self[i].shift(self[i+1].get_height() * DOWN / 2)
elif c == ",":
self[i].shift(self[i].get_height() * DOWN / 2)
if self.unit and self.unit.startswith("^"):

View File

@ -109,6 +109,7 @@ class GraphScene(Scene):
numbers_with_elongated_ticks=self.y_labeled_nums,
color=self.axes_color,
line_to_number_vect=LEFT,
label_direction=LEFT,
)
y_axis.shift(self.graph_origin - y_axis.number_to_point(0))
y_axis.rotate(np.pi / 2, about_point=y_axis.number_to_point(0))