- class MobjectMatrix(matrix, element_to_mobject=<function MobjectMatrix.<lambda>>, **kwargs)[source]#
A mobject that displays a matrix of mobject entries on the screen.
Example: MobjectMatrixExample ¶
from manim import * class MobjectMatrixExample(Scene): def construct(self): a = Circle().scale(0.3) b = Square().scale(0.3) c = MathTex("\pi").scale(2) d = Star().scale(0.3) m0 = MobjectMatrix([[a, b], [c, d]]) self.add(m0)
matrix – A numpy 2d array or list of lists.
v_buff – Vertical distance between elements, by default 0.8.
h_buff – Horizontal distance between elements, by default 1.3.
bracket_h_buff – Distance of the brackets from the matrix, by default
bracket_v_buff – Height of the brackets, by default
Trueif should add backgraound rectangles to entries, by default
Trueif should include background rectangle, by default
element_to_mobject – The mobject class used to construct the elements, by default
element_to_mobject_config – Additional arguments to be passed to the constructor in
element_to_mobject, by default
element_alignment_corner – The corner to which elements are aligned, by default
left_bracket – The left bracket type, by default
right_bracket – The right bracket type, by default
Trueif should stretch the brackets to fit the height of matrix contents, by default
bracket_config – Additional arguments to be passed to
MathTexwhen constructing the brackets.
Used to animate the application of any method of
The depth of the mobject.
If there are multiple colors (for gradient) this returns the first one
The height of the mobject.
The width of the mobject.