ApplyMatrix

from manim import *

import numpy as np

class ApplyMatrixExample(Scene):

def construct(self):

#to do this you need to just know this one basic stuff of numpy on how it handles matrices

#here's how it does it:

matrix2x2 = np.array([[1, 2], [2, 1]])

matrix3x3 = np.array([[1, 2, 3], [0, 1, 1], [3, 2, 1]])

Grid = NumberPlane();

self.play(Create(Grid))

ThreeDGrid = ThreeDAxes()

self.play(ApplyMatrix(matrix2x2, Grid))

self.remove(Grid)

self.play(Create(ThreeDGrid))

self.play(ApplyMatrix(matrix3x3, ThreeDGrid))

self.wait(1)
!