manim: lines and graphs are not shown!
I am running the following codes and it seems manim has an issue with lines and graphs illustrations.
class CreateLine(Scene):
def construct(self):
start=(0,0,0)
end=(4,0,0)
line=Line(start, end)
self.play(ShowCreation(line))
class PlotSin(Scene):
def construct(self):
axes = Axes((-3, 10), (-1, 8),
axis_config={
"stroke_color": GREY_A,
"stroke_width": 2,
"fill_opacity": 1,
}
)
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,
)
sin_label = axes.get_graph_label(sin_graph, "\\sin(x)")
self.play(
ShowCreation(sin_graph),
FadeIn(sin_label, RIGHT),
)
I should mention that I have OpenGL V4.6 installed on my laptop and my graphic renderer is Intel® UHD.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 18 (6 by maintainers)
This is my new one. I’ve written my solution here. Please check it out.
Can you try
python -m moderngl
in both cases? Can you try installing mesa to see if it makes it work on Windows?Which is also the same as #1455