manim.mobject.matrix.Matrix

class Matrix(matrix, v_buff=0.8, h_buff=1.3, bracket_h_buff=0.25, bracket_v_buff=0.25, add_background_rectangles_to_entries=False, include_background_rectangle=False, element_to_mobject=<class 'manim.mobject.svg.tex_mobject.MathTex'>, element_to_mobject_config={}, element_alignment_corner=array([ 1., -1., 0.]), left_bracket='\\big[', right_bracket='\\big]', **kwargs)[source]

Bases: manim.mobject.types.vectorized_mobject.VMobject

Matrix can either either include numbers, tex_strings, or mobjects

Methods

add_background_to_entries

add_brackets

get_brackets

get_columns

get_entries

get_mob_matrix

get_rows

Return rows of the matrix as VGroups

matrix_to_mob_matrix

organize_mob_matrix

set_column_colors

set_row_colors

Set individual colors for each row of the matrix

Attributes

animate

Used to animate the application of a method.

get_rows()[source]

Return rows of the matrix as VGroups

Returns

Each VGroup contains a row of the matrix.

Return type

List[VGroup]

set_row_colors(*colors)[source]

Set individual colors for each row of the matrix

Parameters

colors (str) – The list of colors; each color specified corresponds to a row.

Returns

The current matrix object (self).

Return type

Matrix