Manim说Graphscene不存在

发布于 2025-02-13 23:45:09 字数 785 浏览 0 评论 0原文

我刚刚开始使用Manim,但是当我尝试绘制图表时,它给我以下错误:“ nameRror:name'GraphScene'未定义”

我的代码在这里列出:

from manim import *
import numpy as np

class graphx(GraphScene):
    CONFIG={
        "x_min":-4,
        "x_max":4,
        "x_axis_label":"$x$",
        "y_axis_label":"$y$"
    }

    def show_function_graph(self):
        self.setup_axis(animate=True)
        def func(x):
            return ((x+1)//2)**x
        graph=self.get_graph(func,x_min=-1,x_max=1)
        self.play(ShowCreation(graph))

    def construct(self):
        self.show_function_graph()

#manim -pql newmanim.py graphx

Sidenote:Sidenote:我关注YouTube教程:< a href =“ https://www.youtube.com/watch?v=gemuxcuebvu” rel =“ nofollow noreferrer”> https://www.youtube.com/watch?v=gemuxcuebvu

I have just started using manim, however when I try to draw a graph it gives me the following error: "NameError: name 'GraphScene' is not defined"

my code is listed here:

from manim import *
import numpy as np

class graphx(GraphScene):
    CONFIG={
        "x_min":-4,
        "x_max":4,
        "x_axis_label":"$x
quot;,
        "y_axis_label":"$y
quot;
    }

    def show_function_graph(self):
        self.setup_axis(animate=True)
        def func(x):
            return ((x+1)//2)**x
        graph=self.get_graph(func,x_min=-1,x_max=1)
        self.play(ShowCreation(graph))

    def construct(self):
        self.show_function_graph()

#manim -pql newmanim.py graphx

sidenote: I'm following a youtube tutorial: https://www.youtube.com/watch?v=GemuXCUEBVU

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文