Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

add_background_rectangles -> add_background_rectangles_to_entries

Grant Sanderson0da1abc689a0
diff --git a/mobject/matrix.py b/mobject/matrix.py
index 5173fa23b..58a9f2202 100644
--- a/mobject/matrix.py
+++ b/mobject/matrix.py
@@ -40,7 +40,7 @@ def vector_coordinate_label(vector_mob, integer_labels=True,
vect = np.round(vect).astype(int)
vect = vect[:n_dim]
vect = vect.reshape((n_dim, 1))
- label = Matrix(vect, add_background_rectangles=True)
+ label = Matrix(vect, add_background_rectangles_to_entries=True)
label.scale(VECTOR_LABEL_SCALE_FACTOR)
shift_dir = np.array(vector_mob.get_end())
@@ -59,7 +59,7 @@ class Matrix(VMobject):
CONFIG = {
"v_buff": 0.8,
"h_buff": 1.3,
- "add_background_rectangles": False,
+ "add_background_rectangles_to_entries": False,
"element_to_mobject": TexMobject,
"element_to_mobject_config": {},
"element_alignment_corner": DR,
@@ -82,14 +82,15 @@ class Matrix(VMobject):
self.center()
self.mob_matrix = mob_matrix
- if self.add_background_rectangles:
+ if self.add_background_rectangles_to_entries:
for mob in self.elements:
mob.add_background_rectangle()
def matrix_to_mob_matrix(self, matrix):
return np.vectorize(
lambda e: self.element_to_mobject(
- e, **self.element_to_mobject_config)
+ e, **self.element_to_mobject_config
+ )
)(matrix)
def organize_mob_matrix(self, matrix):
diff --git a/old_projects/eola/chapter3.py b/old_projects/eola/chapter3.py
index 4b7d56ed9..876f3f569 100644
--- a/old_projects/eola/chapter3.py
+++ b/old_projects/eola/chapter3.py
@@ -887,7 +887,7 @@ class MatrixVectorMultiplication(LinearTransformationScene):
)
concrete_matrix = Matrix(
copy.deepcopy(abstract_matrix),
- add_background_rectangles = True
+ add_background_rectangles_to_entries = True
)
concrete_matrix.to_edge(UP)
if self.abstract:
diff --git a/old_projects/eola/chapter4.py b/old_projects/eola/chapter4.py
index 833f84c9a..b8f70c245 100644
--- a/old_projects/eola/chapter4.py
+++ b/old_projects/eola/chapter4.py
@@ -106,7 +106,7 @@ class FollowLinearCombination(LinearTransformationScene):
direction = "right", color = Y_COLOR
)
vect = self.add_vector(vect_coords)
- vect_array = Matrix(["x", "y"], add_background_rectangles = True)
+ vect_array = Matrix(["x", "y"], add_background_rectangles_to_entries = True)
v_equals = TexMobject(["\\vec{\\textbf{v}}", "="])
v_equals.split()[0].set_color(YELLOW)
v_equals.next_to(vect_array, LEFT)