Search code examples
pythonkeywordgetattrmanim

Manim code doesn't work gives error "Mobject.getattr.<locals>.getter() got an unexpected keyword argument "x_range"


I repeat the video on tutorials on creating a graph in manim. I do everything the same as in the video, but I get an error, I attach the code below and the error too.[enter image description here](https://i.sstatic.net/plDxB.png)

I tried to remove the code on line 9, and everything works out for me, but there is no parabola. I had a similar problem and with the height argument I thought the problem was in the library, I reinstalled everything, it didn’t help and now I think that I’m doing something wrong. Where could I be wrong? I'm not strong in Python, only now I'm learning a beginner. Help me please.


Solution

  • You are likely following an outdated tutorial: the get_graph method has been renamed to plot quite a while ago. Change your line

    plane.get_graph(lambda x: x**2, ...)
    

    to

    plane.plot(lambda x: x**2, ...)
    

    and the code should compile.

    In general: please don't share your code via screenshots here, just copy/paste it within a code block.