Skip to content

Engine extensions (manim_live_extra) ​

These are not standard Manim mobjects. They live on the engine-extension lane: the code must say from manim_live_extra import …, they render only in this engine, and a local CLI export is refused up front by the export gate (see Support Surface). The 34 shapes on this page group by purpose: charts and statistics 14, maths visualisation 2, biology 3, chemistry 1, machine learning 5, probability 1, network and flow 1, 3D 5, fractals 2.

This page lists 34 examples. The code is imported from corpus/examples/extras/; the screenshots are end states rendered on real machines.

Histogram ​

A four-bar histogram whose bar heights are the bucket counts (rising to the right), with axes drawn automatically.

Histogram

py
"""直方图 Histogram

@expect 四根柱子的直方图,柱高按各桶计数、右高左低,坐标轴自动生成。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import Histogram


class HistogramScene(Scene):
    def construct(self):
        hist = Histogram(data=[1, 2, 2, 3, 3, 3, 4, 4, 5], bins=4, fill_opacity=0.8)
        self.play(Create(hist))
        self.wait(0.3)

Box plot (BoxPlot) ​

Two box plots side by side (box, whiskers, outliers); the left group sits overall higher than the right.

Box plot (BoxPlot)

py
"""箱线图 BoxPlot

@expect 两组并排的箱线图(箱 + 须 + 离群点),左组数据整体高于右组。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import BoxPlot


class BoxPlotScene(Scene):
    def construct(self):
        plot = BoxPlot(data=[[62, 65, 68, 70, 72, 74, 76, 90], [40, 44, 48, 50, 52, 56, 58, 71]])
        self.play(Create(plot))
        self.wait(0.3)

Violin plot (ViolinPlot) ​

Two violins (kernel-density outlines) side by side, each swelling where the data is densest.

Violin plot (ViolinPlot)

py
"""小提琴图 ViolinPlot

@expect 两把「小提琴」(核密度轮廓)并排,提琴宽度随数据密度起伏。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import ViolinPlot


class ViolinPlotScene(Scene):
    def construct(self):
        plot = ViolinPlot(data=[[1, 1.2, 1.3, 2, 2.1, 2.2, 2.9], [1.8, 2.5, 3, 3.1, 3.2, 4, 4.2]])
        self.play(Create(plot))
        self.wait(0.3)

Scatter plot (ScatterPlot) ​

A cloud of positively correlated points (larger x, larger y) with axes drawn automatically.

Scatter plot (ScatterPlot)

py
"""散点图 ScatterPlot

@expect 一片正相关的散点(x 越大 y 越大),坐标轴自动生成。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import ScatterPlot


class ScatterPlotScene(Scene):
    def construct(self):
        x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        y = [0.1, 0.9, 2.2, 2.8, 4.1, 5.0, 5.9, 7.2, 7.9, 9.1]
        plot = ScatterPlot(x=x, y=y)
        self.play(Create(plot))
        self.wait(0.3)

Stacked bar chart (StackedBarChart) ​

Three bars, each stacked from two colour segments (blue below, green above), with a legend.

Stacked bar chart (StackedBarChart)

py
"""堆叠柱状图 StackedBarChart

@expect 三根柱子,每根由两段颜色堆成(下蓝上绿),带图例。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import StackedBarChart


class StackedBarScene(Scene):
    def construct(self):
        chart = StackedBarChart(values=[[3, 4, 2], [2, 1, 4]], series_names=["线上", "线下"])
        chart.move_to(ORIGIN)  # 上游图表类默认从原点往右上构图,不居中会偏出画面
        self.play(Create(chart))
        self.wait(0.3)

Area chart (AreaChart) ​

Two bands filled down to the baseline in different colours, partially overlapping and rippling with x.

Area chart (AreaChart)

py
"""面积图 AreaChart

@expect 两条填充到基线的面积带(颜色不同、部分重叠),随 x 起伏。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import AreaChart


class AreaChartScene(Scene):
    def construct(self):
        chart = AreaChart(values=[[1, 3, 2, 4, 3, 5], [2, 2, 3, 2, 4, 3]])
        self.play(Create(chart))
        self.wait(0.3)

Step chart (StepChart) ​

A staircase polyline that jumps horizontally then vertically between data points, each point marked with a dot.

Step chart (StepChart)

py
"""阶梯图 StepChart

@expect 一条台阶状的折线(数据点之间水平 / 垂直跳变),各点带圆点。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import StepChart


class StepChartScene(Scene):
    def construct(self):
        chart = StepChart(values=[1, 1, 3, 3, 2, 2, 5], show_dots=True)
        self.play(Create(chart))
        self.wait(0.3)

Calendar heatmap (CalendarHeatmap) ​

A row of week-aligned cells (a calendar) whose shading follows each day’s value.

Calendar heatmap (CalendarHeatmap)

py
"""日历热图 CalendarHeatmap

@expect 一排按周对齐的格子(日历),颜色深浅随每天的数值变化。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import CalendarHeatmap


class CalendarScene(Scene):
    def construct(self):
        data = [{"date": f"2026-06-{day:02d}", "value": (day * 7) % 11} for day in range(1, 29)]
        chart = CalendarHeatmap(data=data)
        chart.move_to(ORIGIN)  # 上游图表类默认从原点往右上构图,不居中会偏出画面
        self.play(Create(chart))
        self.wait(0.3)

Pie chart (PieChart) ​

A pie in three slices (2:1:1) with a text label on each.

Pie chart (PieChart)

py
"""饼图 PieChart

@expect 一张三块的饼(占比 2:1:1),每块带文字标签。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import PieChart


class PieChartScene(Scene):
    def construct(self):
        chart = PieChart(values=[5, 2.5, 2.5], labels=["甲", "乙", "丙"])
        self.play(Create(chart))
        self.wait(0.3)

Donut chart (DonutChart) ​

A hollow three-colour ring (3:2:1) with the canvas showing through the middle.

Donut chart (DonutChart)

py
"""环图 DonutChart

@expect 中空的三色圆环(占比 3:2:1),中间能看到画布底色。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import DonutChart


class DonutChartScene(Scene):
    def construct(self):
        chart = DonutChart(values=[3, 2, 1], labels=["A", "B", "C"])
        self.play(Create(chart))
        self.wait(0.3)

Radar chart (RadarChart) ​

A pentagonal grid with a data polygon laid over it (five uneven dimensions), each axis labelled.

Radar chart (RadarChart)

py
"""雷达图 RadarChart

@expect 五边形网格上叠一个数据多边形(五个维度数值不一),维度带标签。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
"""

from manim import *
from manim_live_extra import RadarChart


class RadarChartScene(Scene):
    def construct(self):
        chart = RadarChart(
            data=[0.9, 0.6, 0.75, 0.5, 0.8],
            categories=["速度", "准确", "成本", "覆盖", "易用"],
        )
        self.play(Create(chart))
        self.wait(0.3)

Gantt chart (GanttChart) ​

Two timeline bars (research first, development after and overlapping) with time on the horizontal axis and task names per row.

Gantt chart (GanttChart)

py
"""甘特图 GanttChart

@expect 两条时间条(调研在前、开发在后并有交叠),横轴是时间、行带任务名。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
      tasks 是字典列表(name / start / end / color),过桥后就是上游要的 GanttTask 数组。
"""

from manim import *
from manim_live_extra import GanttChart


class GanttScene(Scene):
    def construct(self):
        chart = GanttChart(tasks=[
            {"name": "调研", "start": 0, "end": 2, "color": BLUE},
            {"name": "开发", "start": 1.5, "end": 4, "color": GREEN},
        ])
        chart.move_to(ORIGIN)  # 上游图表类默认从原点往右上构图,不居中会偏出画面
        self.play(Create(chart))
        self.wait(0.3)

Scalar-field heat map (HeatMap) ​

A field of cells coloured by a function’s value, bright at the centre and fading outward, in a continuous colour ramp with no grid lines.

Scalar-field heat map (HeatMap)

py
"""标量场热图 HeatMap

@expect 一片按函数值着色的色块(中心亮、向外渐变),色带连续无网格线。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
      func 收 (x, y) 返回一个数——与 Surface 的(返回点)不同,返回标量无需过桥包装。
"""

from manim import *
from manim_live_extra import HeatMap


class HeatMapScene(Scene):
    def construct(self):
        field = HeatMap(func=lambda x, y: (x * x + y * y) / 25)
        self.play(FadeIn(field))
        self.wait(0.3)

Contour plot (ContourPlot) ​

Nested closed contour lines (a few rings on a saddle surface); where the lines crowd, the gradient is steep.

Contour plot (ContourPlot)

py
"""等值线图 ContourPlot

@expect 同心闭合的等值线(马鞍面上若干圈),线密的地方梯度大。
@note 引擎扩展车道:标准 Manim 没有此图形;本机 CLI 导出会被前置门拒绝。
      多变量微积分(梯度 / 山脊 / 鞍点)的直接教具。
"""

from manim import *
from manim_live_extra import ContourPlot


class ContourScene(Scene):
    def construct(self):
        field = ContourPlot(func=lambda x, y: (x * x - y * y) / 8)
        self.play(Create(field))
        self.wait(0.3)

Candlestick chart (CandlestickChart) ​

Three candlesticks with bodies and both wicks; gains are red and losses green (the Chinese convention, passed explicitly).

Candlestick chart (CandlestickChart)

py
"""K 线图 CandlestickChart

@expect 三根 K 线:实体 + 上下影线齐全,涨的红、跌的绿(按中国习惯显式指定了涨红跌绿)。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import CandlestickChart


class CandlestickScene(Scene):
    def construct(self):
        chart = CandlestickChart(
            data=[
                {'open': 1.0, 'high': 2.0, 'low': 0.5, 'close': 1.6},
                {'open': 1.6, 'high': 2.4, 'low': 1.2, 'close': 1.3},
                {'open': 1.3, 'high': 2.2, 'low': 1.1, 'close': 2.1},
            ],
            bullish_color=RED,
            bearish_color=GREEN,
        )
        self.play(Create(chart))
        self.wait(0.3)

Waterfall chart (WaterfallChart) ​

Four rise-and-fall segments plus a total bar, joined by connector lines, walking from 3 up to 6.

Waterfall chart (WaterfallChart)

py
"""瀑布图 WaterfallChart

@expect 四段增减加一根总计柱,柱间有连接线,起点 3 逐段走到 6。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import WaterfallChart


class WaterfallScene(Scene):
    def construct(self):
        chart = WaterfallChart(
            values=[3, -1, 2, -2],
            labels=['起步', '支出', '收入', '退款'],
            show_total=True,
            total_label='净额',
        )
        chart.move_to(ORIGIN)  # 上游图表类默认从原点往右上构图,不居中会偏出画面
        self.play(Create(chart))
        self.wait(0.3)

DNA double helix (DNAHelix) ​

Two backbone strands winding in opposite directions with base-pair rungs between them, coloured by base.

DNA double helix (DNAHelix)

py
"""DNA 双螺旋 DNAHelix

@expect 两条反向缠绕的骨架带与之间的碱基横档,按碱基着色。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import DNAHelix


class DNAHelixScene(Scene):
    def construct(self):
        helix = DNAHelix(sequence=['A', 'T', 'G', 'C', 'A'], turns=1.5, radius=1.2)
        helix.scale(0.9)
        self.play(Create(helix))
        self.wait(0.3)

Cell diagram (Cell) ​

A round membrane, a nucleus, and several organelles, each labelled.

Cell diagram (Cell)

py
"""细胞图 Cell

@expect 圆形细胞膜 + 细胞核 + 若干带标注的细胞器。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import Cell


class CellScene(Scene):
    def construct(self):
        cell = Cell(labels=True)
        self.play(Create(cell))
        self.wait(0.3)

Amino-acid chain (AminoAcidChain) ​

A string of beads coloured by residue with peptide-bond links between them.

Amino-acid chain (AminoAcidChain)

py
"""氨基酸链 AminoAcidChain

@expect 一串按残基着色的圆珠,圆珠之间有肽键连线。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import AminoAcidChain


class AminoAcidScene(Scene):
    def construct(self):
        chain = AminoAcidChain(residues=['G', 'A', 'V', 'L', 'K'], bead_radius=0.22)
        chain.scale(1.1)
        self.play(Create(chain))
        self.wait(0.3)

Molecular structure (MoleculeMobject) ​

A water molecule in skeletal form: the oxygen labelled O, two hydrogens labelled H, bonds drawn as lines.

Molecular structure (MoleculeMobject)

py
"""分子结构式 MoleculeMobject

@expect 水分子的骨架式:氧原子标 O、两个氢原子标 H,原子之间是键线。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import MoleculeMobject


class MoleculeScene(Scene):
    def construct(self):
        molecule = MoleculeMobject(
            atoms=[
                {'element': 'O', 'x': 0.0, 'y': 0.0},
                {'element': 'H', 'x': 1.4, 'y': 0.0},
                {'element': 'H', 'x': -0.5, 'y': 1.2},
            ],
            bonds=[{'from': 0, 'to': 1}, {'from': 0, 'to': 2}],
            bond_length=1.2,
        )
        self.play(Create(molecule))
        self.wait(0.3)

Neural network (NeuralNetwork) ​

Three layers of nodes spread left to right with every adjacent pair fully connected, centred in the frame.

Neural network (NeuralNetwork)

py
"""神经网络 NeuralNetwork

@expect 三层节点从左到右排开、相邻层之间连满线,整体在画面中央。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import NeuralNetwork, FeedForwardLayer


class NeuralNetworkScene(Scene):
    def construct(self):
        net = NeuralNetwork(
            [
                FeedForwardLayer(num_nodes=3),
                FeedForwardLayer(num_nodes=4),
                FeedForwardLayer(num_nodes=2),
            ],
            layer_spacing=2.0,
        )
        net.scale(0.8)
        net.move_to(ORIGIN)  # 上游把层从 x=0 往右排(第一层贴原点),不居中会整块偏到右半屏
        self.play(Create(net))
        self.wait(0.3)

Fully connected layer (FeedForwardLayer) ​

A column of four evenly spaced dots.

Fully connected layer (FeedForwardLayer)

py
"""全连接层 FeedForwardLayer

@expect 一列 4 个圆点,等距竖排。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import FeedForwardLayer


class FeedForwardLayerScene(Scene):
    def construct(self):
        layer = FeedForwardLayer(num_nodes=4, node_radius=0.22, node_spacing=0.9)
        self.play(Create(layer))
        self.wait(0.3)

Convolutional layer (ConvolutionalLayer) ​

Three 3×3 feature-map squares side by side.

Convolutional layer (ConvolutionalLayer)

py
"""卷积层 ConvolutionalLayer

@expect 三张 3×3 的特征图方块,横向并排。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import ConvolutionalLayer


class ConvLayerScene(Scene):
    def construct(self):
        layer = ConvolutionalLayer(num_feature_maps=3, map_size=3)
        self.play(Create(layer))
        self.wait(0.3)

Pooling layer (PoolingLayer) ​

Three 2×2 feature-map squares side by side.

Pooling layer (PoolingLayer)

py
"""池化层 PoolingLayer

@expect 三张 2×2 的特征图方块,横向并排。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import PoolingLayer


class PoolingLayerScene(Scene):
    def construct(self):
        layer = PoolingLayer(num_feature_maps=3, map_size=2)
        self.play(Create(layer))
        self.wait(0.3)

Image layer (ImageLayer) ​

A single 5×5 grid of pixel cells.

Image layer (ImageLayer)

py
"""图像层 ImageLayer

@expect 一块 5×5 的像素方格阵列。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import ImageLayer


class ImageLayerScene(Scene):
    def construct(self):
        layer = ImageLayer(rows=5, cols=5, cell_size=0.5)
        self.play(Create(layer))
        self.wait(0.3)

Dice face (DiceFace) ​

A rounded square carrying five pips laid out as the 5 face.

Dice face (DiceFace)

py
"""骰子面 DiceFace

@expect 一个圆角方块,上面按 5 点排布五颗圆点。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import DiceFace


class DiceFaceScene(Scene):
    def construct(self):
        dice = DiceFace(value=5, size=1.6, dot_radius=0.09)
        self.play(Create(dice))
        self.wait(0.3)

Sankey diagram (SankeyDiagram) ​

Two nodes on the left feeding two on the right, with flow ribbons whose width matches the flow.

Sankey diagram (SankeyDiagram)

py
"""桑基图 SankeyDiagram

@expect 两条左侧节点汇入两条右侧节点,带宽度与流量成正比的流带。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import SankeyDiagram


class SankeyScene(Scene):
    def construct(self):
        diagram = SankeyDiagram(
            nodes=[{'id': 'A'}, {'id': 'B'}, {'id': 'C'}, {'id': 'D'}],
            links=[
                {'source': 'A', 'target': 'C', 'value': 3},
                {'source': 'A', 'target': 'D', 'value': 1},
                {'source': 'B', 'target': 'C', 'value': 2},
            ],
            height=4.0,
        )
        diagram.scale(0.85)
        self.play(Create(diagram))
        self.wait(0.3)

Cuboid (Box3D) ​

A cuboid standing on an axis, its faces shaded, unmistakably 3D at a slanted angle.

Cuboid (Box3D)

py
"""长方体 Box3D

@expect 一根坐标轴上立着一个有明暗面的长方体,斜视角一眼是 3D。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import Box3D


class Box3DScene(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        box = Box3D(width=2.5, height=1.6, depth=1.2)
        self.add(axes, box)

3D vector (Vector3D) ​

An arrowed vector reaching out from the origin among three axes.

3D vector (Vector3D)

py
"""三维向量 Vector3D

@expect 从原点伸出的带箭头向量,落在三根坐标轴之间。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import Vector3D


class Vector3DScene(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        vector = Vector3D(end=[2, 1.5, 1.2], color=YELLOW)
        self.add(axes, vector)

Parametric surface (ParametricSurface) ​

A saddle-shaped surface swept out by u and v, with three axes.

Parametric surface (ParametricSurface)

py
"""参数曲面 ParametricSurface

@expect 一块由 u·v 张成的马鞍形曲面,配三根坐标轴。
@note 与 CE 的 Surface 同类但走扩展车道(manim-web 的 ParametricSurface)——标准 Manim 没有这个名字。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import ParametricSurface


class ParametricSurfaceScene(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        surface = ParametricSurface(
            func=lambda u, v: axes.c2p(u, v, u * v),
            u_range=[-2, 2],
            v_range=[-2, 2],
        )
        self.add(axes, surface)

Surface (Surface3D) ​

An upward-curving paraboloid with three axes.

Surface (Surface3D)

py
"""曲面 Surface3D

@expect 一块向上翘起的抛物面,配三根坐标轴。
@note 与 CE 的 Surface 同类但走扩展车道(manim-web 的 Surface3D)——标准 Manim 没有这个名字。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import Surface3D


class Surface3DScene(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        surface = Surface3D(
            func=lambda u, v: axes.c2p(u, v, 0.4 * (u * u - v * v)),
            u_range=[-2, 2],
            v_range=[-2, 2],
        )
        self.add(axes, surface)

Implicit surface (ImplicitSurface) ​

A sphere cut out as the level set x²+y²+z²=1.

Implicit surface (ImplicitSurface)

py
"""隐式曲面 ImplicitSurface

@expect 一个由 x²+y²+z²=1 等值面剖出来的球面。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import ImplicitSurface


class ImplicitSurfaceScene(ThreeDScene):
    def construct(self):
        sphere = ImplicitSurface(
            func=lambda x, y, z: x * x + y * y + z * z - 1,
            x_range=[-1.5, 1.5],
            y_range=[-1.5, 1.5],
            z_range=[-1.5, 1.5],
        )
        self.add(sphere)

Mandelbrot set (MandelbrotSet) ​

A full fractal picture: the cardioid body with small discs around it and colour bands at the boundary.

Mandelbrot set (MandelbrotSet)

py
"""曼德博集 MandelbrotSet

@expect 一块完整的分形图:心形主体加周边小圆盘,边界有色带。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import MandelbrotSet


class MandelbrotScene(Scene):
    def construct(self):
        mandelbrot = MandelbrotSet(width=6.0, height=3.6, max_iterations=120)
        self.add(mandelbrot)
        self.wait(0.3)

Newton fractal (NewtonFractal) ​

A three-colour fractal partitioned by the cube roots of unity, with fine texture along the boundaries.

Newton fractal (NewtonFractal)

py
"""牛顿分形 NewtonFractal

@expect 一块按三次单位根分区的三色分形,边界处有细密纹理。
@note 引擎扩展车道(from manim_live_extra import …):标准 Manim 没有此图形——本机 CLI 导出会被前置门拒绝,只能浏览器渲染 / 逐帧导出。
"""

from manim import *
from manim_live_extra import NewtonFractal


class NewtonFractalScene(Scene):
    def construct(self):
        fractal = NewtonFractal(width=6.0, height=3.6)
        self.add(fractal)
        self.wait(0.3)

MIT licensed · Manim 与 Pyodide 各依其自身许可(见「安装」)