MobjectMatrix

Qualified name: manim.mobject.matrix.MobjectMatrix

class MobjectMatrix(matrix, element_to_mobject=<function MobjectMatrix.<lambda>>, **kwargs)[source]

Bases: manim.mobject.matrix.Matrix

A mobject that displays a matrix of mobject entries on the screen.

Examples

Example: MobjectMatrixExample

../_images/MobjectMatrixExample-1.png
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)
Parameters
  • matrix (typing.Iterable) – A numpy 2d array or list of lists

  • v_buff (float, optional) – vertical buffer, by default 0.8

  • h_buff (float, optional) – horizontal buffer, by default 1.3

  • bracket_h_buff (float, optional) – bracket horizontal buffer, by default MED_SMALL_BUFF

  • bracket_v_buff (float, optional) – bracket vertical buffer, by default MED_SMALL_BUFF

  • add_background_rectangles_to_entries (bool, optional) – True if should add backgraound rectangles to entries, by default False

  • include_background_rectangle (bool, optional) – True if should include background rectangle, by default False

  • element_to_mobject (Mobject, optional) – element to mobject, by default MathTex

  • element_to_mobject_config (Dict[str, Mobject], optional) – element to mobject config, by default {}

  • element_alignment_corner (np.ndarray, optional) – the element alignment corner, by default DR

  • left_bracket (str, optional) – the left bracket type, by default “[”

  • right_bracket (str, optional) – the right bracket type, by default “]”

Methods

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.