Manim说Graphscene不存在
我刚刚开始使用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":"$xquot;,
"y_axis_label":"$yquot;
}
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论