| name | manim |
| description | This skill should be used when the user asks to "create an animation", "make a manim video", "animate this concept", "visualize this process", "create a GIF for my blog", "plot a graph", "animate a value", or mentions "manim", "mathematical animation", "code animation", "process visualization", "technical animation", "3D scene", "camera animation", "ValueTracker", "number animation". Provides ManimCE (Community Edition) syntax, patterns, and best practices for creating programmatic animations. |
| version | 1.5.0 |
Manim Animation Skill
Create precise, programmatic animations for technical blogs, educational content, and concept visualization using Manim Community Edition (ManimCE).
Test animations: https://docs.manim.community/en/stable/examples.html
Installation (v0.19+)
uv venv && source .venv/bin/activate
uv pip install manim
pip install manim
manim checkhealth
Note: v0.19+ uses pyav internally, eliminating the external ffmpeg dependency.
Virtual environment tip: If not activated, use uv run manim ... instead of manim.
Windows Quick Start (PowerShell)
# Install uv (if needed)
python -m pip install --user uv
# Verify uv is on PATH
where uv
# One-off run without creating a venv
uv run --with manim manim checkhealth
If uv is not found, restart the terminal and run where uv again.
ManimCE vs ManimGL
| Aspect | ManimCE (Recommended) | ManimGL |
|---|
| Package | pip install manim | pip install manimgl |
| Stability | Stable, well-documented | Experimental, breaking changes |
| Jupyter | Supported (%%manim magic) | Limited |
| ffmpeg | Not required (v0.19+) | Required |
| Caching | Supported | Not supported |
Always use ManimCE unless reproducing exact 3Blue1Brown videos.
Core Concepts
Three Building Blocks
- Mobjects - Mathematical objects displayed on screen (Circle, Text, Code, etc.)
- Scenes - Canvas containing animations, subclass of
Scene
- Animations - Transformations applied to Mobjects (Create, Write, FadeIn, etc.)
Basic Scene Structure
from manim import *
class MyScene(Scene):
def construct(self):
circle = Circle(color=BLUE)
self.play(Create(circle))
self.wait(1)
Common Mobjects
Text and Labels
text = Text("Hello", font_size=48)
text = Text("Hello World", t2c={"Hello": RED, "World": BLUE})
label = Text("Label").next_to(circle, UP)
Code Blocks (v0.19+)
code = Code(
code_string="""function example() {
return 42;
}""",
language="javascript",
background="rectangle",
formatter_style="monokai",
)
styles = Code.get_styles_list()
LaTeX
tex = Tex(r"\LaTeX", font_size=144)
math = MathTex(r"E = mc^2")
equation = MathTex(r"f(x) &= x^2 \\ g(x) &= x^3")
TeX-Free Numeric Labels (Windows-Safe)
If LaTeX is not installed, avoid Tex, MathTex, and number mobjects that may trigger TeX rendering (Integer, DecimalNumber, Variable with math labels).
Use plain text labels instead:
value = 42
label = Text(str(value), font_size=24)
Shapes
circle = Circle(radius=1, color=BLUE, fill_opacity=0.5)
square = Square(side_length=2, color=RED)
rect = Rectangle(width=3, height=1.5)
arrow = Arrow(LEFT, RIGHT)
line = Line(ORIGIN, UP * 2)
Graphs and Axes
axes = Axes(
x_range=[-3, 3, 1],
y_range=[-5, 5, 1],
axis_config={"color": BLUE}
)
graph = axes.plot(lambda x: x**2, color=WHITE)
label = axes.get_graph_label(graph, label="x^2")
Animation Patterns
Basic Animations
self.play(Create(circle))
self.play(Write(text))
self.play(FadeIn(mob))
self.play(FadeIn(mob, shift=UP))
self.play(FadeOut(mob))
self.play(GrowFromCenter(mob))
self.wait(1)
The .animate Syntax
Prepend .animate to any method to animate the change:
self.play(circle.animate.shift(RIGHT * 2))
self.play(square.animate.scale(2))
self.play(text.animate.set_color(RED))
self.play(mob.animate.shift(UP).scale(0.5).set_color(BLUE))
Transform Animations
self.play(Transform(square, circle))
self.play(ReplacementTransform(old, new))
Simultaneous Animations
self.play(
Create(circle),
Write(text),
FadeIn(arrow),
run_time=2
)
Positioning
Direction Constants
UP, DOWN, LEFT, RIGHT, ORIGIN
UL, UR, DL, DR
Positioning Methods
mob.move_to(ORIGIN)
mob.move_to(LEFT * 3 + UP * 2)
label.next_to(circle, UP, buff=0.5)
mob.shift(RIGHT * 2)
mob.align_to(other, UP)
Grouping
group = VGroup(circle, square, text)
group.arrange(RIGHT, buff=0.5)
group.arrange(DOWN, aligned_edge=LEFT)
boxes = VGroup(*[Square() for _ in range(6)])
boxes.arrange_in_grid(rows=2, cols=3, buff=0.5)
Colors
RED, BLUE, GREEN, YELLOW, WHITE, BLACK, GRAY
ORANGE, PINK, PURPLE, TEAL, GOLD
BLUE_A, BLUE_B, BLUE_C, BLUE_D, BLUE_E
GRAY_A, GRAY_B, GRAY_C, GRAY_D, GRAY_E
color = "#61DAFB"
from manim.utils.color import X11, XKCD
beige = X11.BEIGE
mango = XKCD.MANGO
Rendering Commands
uv run --with manim manim -pql scene.py SceneName
manim -pql scene.py SceneName
manim -pqh scene.py SceneName
manim -qm --format=gif scene.py SceneName
manim -pql -s scene.py SceneName
manim -pql -n 1,3 scene.py SceneName
manim --dry_run scene.py SceneName
Jupyter Notebook
Use the %%manim magic command:
%%manim -qm -v WARNING MyScene
class MyScene(Scene):
def construct(self):
circle = Circle()
self.play(Create(circle))
See references/advanced.md for full Jupyter usage details.
Best Practices
Keep Animations Focused
For blog posts, create short, focused animations (5-15 seconds) that illustrate one concept. Let surrounding text provide context.
Use Helper Functions
def create_node(label, color):
"""Reusable node factory."""
rect = RoundedRectangle(width=2, height=1, color=color, fill_opacity=0.3)
text = Text(label, font_size=20)
text.move_to(rect)
return VGroup(rect, text)
Performance Tips
- Use
-ql during development, render high quality only when ready
- Prefer
Text over Tex when LaTeX isn't needed (faster)
- Use caching: Manim automatically caches partial renders
- Use
-s to quickly preview the final frame
Scene Organization
class MyAnimation(Scene):
def construct(self):
self.show_intro()
self.show_main_concept()
self.show_conclusion()
def show_intro(self):
pass
Additional Resources
Reference Files
For detailed syntax and patterns:
references/mobjects.md - Complete Mobject reference (shapes, text, code, graphs, 3D primitives, numbers, positioning)
references/animations.md - All animation types, Transform vs ReplacementTransform, timing control
references/advanced.md - Camera, 3D, ValueTracker, updaters, config, common mistakes, plugins
references/blog-patterns.md - Common patterns for technical blog animations
Example Files
Working examples in examples/:
examples/basic_scene.py - Minimal scene template
examples/flowchart.py - Animated flowchart pattern
examples/state_diagram.py - State transition visualization
examples/quicksort.py - Quicksort bar animation (algorithm visualization template)
External Resources