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)

Most upvoted comments

Hi, I’ve solved this problem. Please change your graphics processor. I changed my graphics processor and everything becomes fine. vendor: NVIDIA Corporation renderer: GeForce 940MX/PCIe/SSE2 version: 3.3.0 NVIDIA 461.40 python: 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] platform: win32 code: 330

is this your new processor or old one??

This is my new one. I’ve written my solution here. Please check it out.

I’m having the same issue. But i realize that the problem only happen in Windows. Running on Anaconda or Windows directly. In linux there is no problem.

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