0. Command line arguments
manimgl [file] [scene] [flags]
from manimlib import *
import numpy as np
class MiEscena (Scene ):
def construct (self ):
circulo = Circle ()
self .play (ShowCreation (circulo ))
self .wait ()
from manim import *
class MiEscena (Scene ):
def construct (self ):
texto = Text ("Hola mundo" )
self .play (Write (texto ))
self .wait ()
Scene with text and animation
from manim import *
class MiEscena (Scene ):
def construct (self ):
texto = Text ("Hola mundo" )
self .play (Write (texto ))
self .wait ()
self .play (texto .animate .shift (UP ))
self .wait ()
self .play (circulo .animate .shift (UP ))
self .play (circulo .animate .move_to (RIGHT * 2 ))
texto = Text ("Mi Texto" )
self .play (Write (texto ))
texto = Tex ("Mi Texto" )
self .play (Write (texto ))
Change color with animation
self .play (circulo .animate .set_color (RED ))
circulo .set_color_by_gradient (RED , BLUE )
Gradient color with animation
self .play (circulo .animate .set_submobject_colors_by_gradient (BLUE , RED ))
Change height with animation
self .play (circulo .animate .set_height (2 ))
Change width with animation
self .play (circulo .animate .set_width (2 ))
circulo .set_stroke (width = 2 )
Change stroke width with animation
self .play (circulo .animate .set_stroke (width = 2 ))
circulo .set_stroke (color = RED )
grupo = VGroup (circulo , texto )
Get number of objects in group
from manimlib import *
import numpy as np
class MiEscena (Scene ):
def construct (self ):
grafica = Axes (
x_range = [- 2 , 2 , 1 ],
y_range = [- 2 , 2 , 1 ],
x_length = 6 ,
y_length = 6 ,
axis_config = {"include_tip" : True },
)
grafica .add_coordinate_labels ()
funcion = grafica .get_graph (lambda x : np .sin (x ), color = BLUE )
self .play (ShowCreation (grafica ))
self .play (ShowCreation (funcion ))
self .wait ()