所以 manim 安装正确我可以转换我可以看到乳胶公式,除了我试图绘制图表
from manimlib.imports import *
class PlotFunctions(GraphScene):
CONFIG = {
"x_min" : -10,
"x_max" : 10,
"x_tick_frequency": 1,
"y_min" : -15,
"y_max" : 15,
"y_tick_frequency": 1,
"graph_origin" : ORIGIN ,
"function_color" : RED ,
"axes_color" : GREEN,
"x_labeled_nums" :range(-10,10,5),
"y_labeled_nums":range(-15,15,5),
}
def construct(self):
self.setup_axes(animate=True)
func_graph=self.get_graph(self.func_to_graph,self.function_color)
func_graph2=self.get_graph(self.func_to_graph2)
#vert_line = self.get_vertical_line_to_graph(TAU,func_graph,color=YELLOW)
#graph_lab = self.get_graph_label(func_graph, label = "\\cos(x)")
#graph_lab2=self.get_graph_label(func_graph2,label = "\\sin(x)", x_val=-10, direction=UP/2)
#two_pi = TexMobject("x = 2 \\pi")
#label_coord = self.input_to_graph_point(TAU,func_graph)
#two_pi.next_to(label_coord,RIGHT+UP)
self.play(ShowCreation(func_graph),ShowCreation(func_graph2))
#self.play(ShowCreation(vert_line), ShowCreation(graph_lab), ShowCreation(graph_lab2),ShowCreation(two_pi))
def func_to_graph(self,x):
return x*x
def func_to_graph2(self,x):
a=x-1
b=x-2
c=x-3
d=x-4
e=a*b
f=c*d
g=e/f
return g
在我使用 abcd 的最后一部分中,我只是试图定义 (x-1)(x-2)/(x-3)(x-4) 并且我尝试正常但我仍然得到错误的图表
感谢您提供任何帮助如果可能的话