mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 13:34:19 +08:00
add_background_rectangles -> add_background_rectangles_to_entries
This commit is contained in:
@ -40,7 +40,7 @@ def vector_coordinate_label(vector_mob, integer_labels=True,
|
|||||||
vect = np.round(vect).astype(int)
|
vect = np.round(vect).astype(int)
|
||||||
vect = vect[:n_dim]
|
vect = vect[:n_dim]
|
||||||
vect = vect.reshape((n_dim, 1))
|
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)
|
label.scale(VECTOR_LABEL_SCALE_FACTOR)
|
||||||
|
|
||||||
shift_dir = np.array(vector_mob.get_end())
|
shift_dir = np.array(vector_mob.get_end())
|
||||||
@ -59,7 +59,7 @@ class Matrix(VMobject):
|
|||||||
CONFIG = {
|
CONFIG = {
|
||||||
"v_buff": 0.8,
|
"v_buff": 0.8,
|
||||||
"h_buff": 1.3,
|
"h_buff": 1.3,
|
||||||
"add_background_rectangles": False,
|
"add_background_rectangles_to_entries": False,
|
||||||
"element_to_mobject": TexMobject,
|
"element_to_mobject": TexMobject,
|
||||||
"element_to_mobject_config": {},
|
"element_to_mobject_config": {},
|
||||||
"element_alignment_corner": DR,
|
"element_alignment_corner": DR,
|
||||||
@ -82,14 +82,15 @@ class Matrix(VMobject):
|
|||||||
self.center()
|
self.center()
|
||||||
|
|
||||||
self.mob_matrix = mob_matrix
|
self.mob_matrix = mob_matrix
|
||||||
if self.add_background_rectangles:
|
if self.add_background_rectangles_to_entries:
|
||||||
for mob in self.elements:
|
for mob in self.elements:
|
||||||
mob.add_background_rectangle()
|
mob.add_background_rectangle()
|
||||||
|
|
||||||
def matrix_to_mob_matrix(self, matrix):
|
def matrix_to_mob_matrix(self, matrix):
|
||||||
return np.vectorize(
|
return np.vectorize(
|
||||||
lambda e: self.element_to_mobject(
|
lambda e: self.element_to_mobject(
|
||||||
e, **self.element_to_mobject_config)
|
e, **self.element_to_mobject_config
|
||||||
|
)
|
||||||
)(matrix)
|
)(matrix)
|
||||||
|
|
||||||
def organize_mob_matrix(self, matrix):
|
def organize_mob_matrix(self, matrix):
|
||||||
|
@ -887,7 +887,7 @@ class MatrixVectorMultiplication(LinearTransformationScene):
|
|||||||
)
|
)
|
||||||
concrete_matrix = Matrix(
|
concrete_matrix = Matrix(
|
||||||
copy.deepcopy(abstract_matrix),
|
copy.deepcopy(abstract_matrix),
|
||||||
add_background_rectangles = True
|
add_background_rectangles_to_entries = True
|
||||||
)
|
)
|
||||||
concrete_matrix.to_edge(UP)
|
concrete_matrix.to_edge(UP)
|
||||||
if self.abstract:
|
if self.abstract:
|
||||||
|
@ -106,7 +106,7 @@ class FollowLinearCombination(LinearTransformationScene):
|
|||||||
direction = "right", color = Y_COLOR
|
direction = "right", color = Y_COLOR
|
||||||
)
|
)
|
||||||
vect = self.add_vector(vect_coords)
|
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 = TexMobject(["\\vec{\\textbf{v}}", "="])
|
||||||
v_equals.split()[0].set_color(YELLOW)
|
v_equals.split()[0].set_color(YELLOW)
|
||||||
v_equals.next_to(vect_array, LEFT)
|
v_equals.next_to(vect_array, LEFT)
|
||||||
|
Reference in New Issue
Block a user