🛠️ Setup & test run
For students who find installation confusing. Step-by-step instructions for Windows, macOS, Linux, plus an online-notebook option and a first test video.
A guided path where NAMSSN UI students learn to turn ideas into short Manim clips: from installing the library, to writing scenes, to animating graphs and integrals for talks and events.
Manim is a Python library for turning mathematical ideas into clear, structured animations. You can show how a graph changes as a parameter shifts, how a pattern emerges step by step, or how a concept fits together when each piece appears at the right moment. It helps you present mathematics in a way that feels organised, visual, and easy to follow.
This lab is designed so that a student can go from “I have never animated anything” to “I can confidently generate my own clip.” You move through small modules: setup, first scene, text & mathematics, shapes, graphs, and finally more advanced animations.
Use the modules on the left to learn concepts and copy patterns. Use the editor on the right to build your own scenes, save them, and then run them on your laptop or in a shared notebook.
For students who find installation confusing. Step-by-step instructions for Windows, macOS, Linux, plus an online-notebook option and a first test video.
Learn the core building blocks: Scene, Text, MathTex,
positioning, colours, and simple transitions that already look professional.
Graphs, parameter changes, highlights, and short clips for events like the ODE–Integration Bee, course projects, and outreach videos.
Before you write scenes, you need a place to run them. You have two realistic options: your own laptop or an online notebook.
For a student community, a shared notebook can be a gentle starting point, while those who want full control set up Manim locally using the detailed setup guide.
The exact commands depend on operating system and Python version, but the rough pattern is:
# 1. Create a virtual environment (optional but recommended)
python -m venv manim-env
# Activate the environment (on Windows)
manim-env\Scripts\activate
# or (on macOS / Linux)
source manim-env/bin/activate
# 2. Install Manim Community Edition
pip install manim
After installation, you should be able to run a command like
manim -h in your terminal and see Manim’s help text.
The full step-by-step version, including screenshots ideas and troubleshooting,
lives in the Manim setup guide.
Suppose you save a file called hello_manim.py containing one Scene class.
A typical command to render it looks like:
manim hello_manim.py HelloWorld -pqh
HelloWorld is the name of the Scene class.-p opens the video after rendering.-q sets quality (e.g. -ql for low, -qh for high).
The editor on this page helps you write the code. To actually see the animation,
you copy it into a .py file or notebook and run Manim there.
A Manim project is just Python code. The smallest useful scene has three ingredients:
a Scene subclass, a construct method, and one or two animations.
from manim import *
class HelloWorld(Scene):
def construct(self):
text = Tex("Hello, NAMSSN UI!")
self.play(Write(text))
self.wait(1)
This creates a white screen, writes the text, and holds for one second.
You will see three recurring types of objects:
Scene).Write, FadeIn, Transform, …).Think of it as: define mobjects → choose animations → play them in order. The detailed story, with more labelled examples, is in Basics Module A.
Manim can display plain text and LaTeX mathematics. This is the foundation for lecture clips, ODE–Bee intros, and little “fact of the week” animations.
title = Text("ODE–Integration Bee 2.0")
equation = MathTex(r"\int_0^1 x^n\,dx = \frac{1}{n+1}")
Text handles regular words.MathTex (or Tex) handles LaTeX maths strings.title.to_edge(UP)
equation.next_to(title, DOWN, buff=0.5)
Common positioning helpers:
to_edge, next_to, shift, scale.
A typical slide-like scene: a title at the top, an equation in the centre, a short remark below. The full explanation with diagrams is under Basics Module C.
Shapes and lines let you illustrate intervals, regions, and “movement” on the real line.
square = Square().set_fill(color=BLUE, opacity=0.5)
circle = Circle().set_stroke(color=YELLOW, width=4)
circle.next_to(square, RIGHT)
You can change set_fill, set_stroke, and use colours like
BLUE, GREEN, RED, GOLD, …
line = NumberLine(x_range=[-1, 4, 1])
dot = Dot(color=RED).move_to(line.n2p(0))
self.play(Create(line))
self.play(FadeIn(dot))
self.play(dot.animate.move_to(line.n2p(3)))
This simple idea (a moving point on a line) already gives you a nice way to demonstrate limits, sequences, or “time” along a process.
Graphs are central for calculus and ODEs: you can show how functions behave and how parameters change their shape.
axes = Axes(
x_range=[-2, 2, 1],
y_range=[-1, 4, 1],
x_length=6,
y_length=4,
)
graph = axes.plot(lambda x: x**2, color=GREEN)
self.play(Create(axes), Create(graph))
k = ValueTracker(1)
def get_graph():
return axes.plot(lambda x: x**2 + k.get_value(), color=BLUE)
graph = get_graph()
self.play(Create(axes), Create(graph))
for new_val in [0, 2, -1]:
self.play(
k.animate.set_value(new_val),
Transform(graph, get_graph()),
run_time=1.2
)
ValueTracker + Transform is a powerful pattern for “live” mathematics.
The projects page builds on this to create full clips.
Finally, you can make your scenes feel professional by combining animations, camera moves, and multiple scenes that tell one story.
from manim import *
class IntegralStory(Scene):
def construct(self):
title = Text("A friendly integral").to_edge(UP)
eq1 = MathTex(r"\int_0^1 x^n\,dx").next_to(title, DOWN)
eq2 = MathTex(r"= \frac{1}{n+1}").next_to(eq1, DOWN)
self.play(Write(title))
self.play(Write(eq1))
self.wait(0.5)
self.play(Transform(eq1, eq2))
self.wait(1)
Once you are comfortable, you can use self.camera.frame to zoom into part of the screen,
or move attention across a long derivation. This is more advanced and can be explored from the Manim
documentation and shared example files linked from NAMSSN resources.
For NAMSSN UI, it is enough in the first year if students can produce clear, static scenes with clean animations. Camera tricks can come later.
When you are comfortable with all modules above, you are ready to script short clips for the ODE–Integration Bee, course projects, and outreach videos. At that stage, use the projects page and official Manim documentation as a playground for your own ideas.
Use this box to draft Manim scenes. The code is regular Python, so you can copy it into a
.py file or a notebook and run it with Manim on your computer or in an online environment.
hello_namssn.py and run Manim from your terminal or notebook.
This page does not render video (that would require a full Python environment), but you can run your scene in two steps:
my_scene.py on your laptop or into
a Manim-enabled notebook.manim my_scene.py MyScene -pql in your terminal.A Manim-ready notebook or shared environment can be linked here so that students without a local installation can still practise and contribute.