我在运行manimgl代码的时候发生了错误
这是我的代码:
from manimlib import *
class GraphExample(Scene):
def construct(self):
axes = Axes((-3, 10), (-1, 8))
axes.add_coordinate_labels()
self.play(Write(axes, lag_ratio=0.01, run_time=1))
# Axes.get_graph will return the graph of a function
sin_graph = axes.get_graph(
lambda x: 2 * math.sin(x),
color=BLUE,
)
# By default, it draws it so as to somewhat smoothly interpolate
# between sampled points (x, f(x)). If the graph is meant to have
# a corner, though, you can set use_smoothing to False
relu_graph = axes.get_graph(
lambda x: max(x, 0),
use_smoothing=False,
color=YELLOW,
)
# For discontinuous functions, you can specify the point of
# discontinuity so that it does not try to draw over the gap.
step_graph = axes.get_graph(
lambda x: 2.0 if x > 3 else 1.0,
discontinuities=[3],
color=GREEN,
)
# Axes.get_graph_label takes in either a string or a mobject.
# If it's a string, it treats it as a LaTeX expression. By default
# it places the label next to the graph near the right side, and
# has it match the color of the graph
sin_label = axes.get_graph_label(sin_graph, "\\sin(x)")
relu_label = axes.get_graph_label(relu_graph, Text("ReLU"))
step_label = axes.get_graph_label(step_graph, Text("Step"), x=4)
self.play(
ShowCreation(sin_graph),
FadeIn(sin_label, RIGHT),
)
self.wait(2)
self.play(
ReplacementTransform(sin_graph, relu_graph),
FadeTransform(sin_label, relu_label),
)
self.wait()
self.play(
ReplacementTransform(relu_graph, step_graph),
FadeTransform(relu_label, step_label),
)
self.wait()
parabola = axes.get_graph(lambda x: 0.25 * x**2)
parabola.set_stroke(BLUE)
self.play(
FadeOut(step_graph),
FadeOut(step_label),
ShowCreation(parabola)
)
self.wait()
# You can use axes.input_to_graph_point, abbreviated
# to axes.i2gp, to find a particular point on a graph
dot = Dot(color=RED)
dot.move_to(axes.i2gp(2, parabola))
self.play(FadeIn(dot, scale=0.5))
# A value tracker lets us animate a parameter, usually
# with the intent of having other mobjects update based
# on the parameter
x_tracker = ValueTracker(2)
f_always(
dot.move_to,
lambda: axes.i2gp(x_tracker.get_value(), parabola)
)
self.play(x_tracker.animate.set_value(4), run_time=3)
self.play(x_tracker.animate.set_value(-2), run_time=3)
self.wait()
错误输出:
Traceback (most recent call last):
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\张荣\AppData\Local\Programs\Python\Python39-32\Scripts\manimgl.exe\__main__.py", line 7, in <module>
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\__main__.py", line 25, in main
scene.run()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\scene\scene.py", line 91, in run
self.construct()
File "main.py", line 5, in construct
axes.add_coordinate_labels()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\coordinate_systems.py", line 437, in add_coordinate_labels
labels = axis.add_numbers(values, **kwargs)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\number_line.py", line 179, in add_numbers
numbers.add(self.get_number_mobject(x, **kwargs))
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\number_line.py", line 149, in get_number_mobject
num_mob = DecimalNumber(x, **number_config)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\numbers.py", line 31, in __init__
self.set_submobjects_from_number(number)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\numbers.py", line 38, in set_submobjects_from_number
self.add(*map(string_to_mob_, num_string))
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\numbers.py", line 36, in <lambda>
string_to_mob_ = lambda s: self.string_to_mob(s, **self.text_config)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\numbers.py", line 92, in string_to_mob
mob = mob_class(string, font_size=1, **kwargs)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\text_mobject.py", line 149, in __init__
super().__init__(text, **kwargs)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\labelled_string.py", line 64, in __init__
super().__init__()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 65, in __init__
self.init_svg_mobject()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 76, in init_svg_mobject
self.generate_mobject()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\labelled_string.py", line 79, in generate_mobject
super().generate_mobject()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 102, in generate_mobject
mobjects = self.get_mobjects_from(svg)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 156, in get_mobjects_from
mob = self.path_to_mobject(shape)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 221, in path_to_mobject
return VMobjectFromSVGPath(path, **self.path_string_config)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 301, in __init__
super().__init__(**kwargs)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\types\vectorized_mobject.py", line 85, in __init__
super().__init__(**kwargs)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\mobject.py", line 89, in __init__
self.init_points()
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 327, in init_points
np.save(tris_filepath, self.get_triangulation())
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\mobject\types\vectorized_mobject.py", line 955, in get_triangulation
earclip_triangulation(inner_verts, rings)
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\manimlib\utils\space_ops.py", line 419, in earclip_triangulation
ringenum = ProgressDisplay(
File "c:\users\张荣\appdata\local\programs\python\python39-32\lib\site-packages\tqdm\_tqdm.py", line 770, in __init__
raise (TqdmDeprecationWarning("""\
tqdm._tqdm.TqdmKeyError: "Unknown argument(s): {'delay': 3}"
这是怎么回事呢?