ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
24.91k stars 1.74k forks source link

add_axes() not working #2425

Closed TheCoder2132 closed 2 years ago

TheCoder2132 commented 2 years ago

Description of bug / unexpected behavior

Whenever I am trying to use add_axes method() [https://docs.manim.community/en/stable/reference/manim.scene.vector_space_scene.VectorScene.html?highlight=add_axes#manim.scene.vector_space_scene.VectorScene.add_axes], following error is coming "TypeError: init() got an unexpected keyword argument 'tick_frequency' ".

Expected behavior

I expect to get an axis on the screen.

How to reproduce the issue

class Vector(VectorScene): def construct(self):

    self.add_axes(animate=True)
This calls add_axes once.Even this much code gives error. ```py class Vector(VectorScene): def construct(self): self.add_axes(animate=True) self.add_plane(animate=True) BasisVecs=self.get_basis_vectors() self.add(BasisVecs) self.wait() ```

Additional media files

Images/GIFs

Logs

Terminal output ``` ┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐ │ │ │ C:\tools\Manim\Lib\site-packages\manim\cli\render\commands.py:139 in render │ │ │ │ 136 │ │ for SceneClass in scene_classes_from_file(file): │ │ 137 │ │ │ try: │ │ 138 │ │ │ │ scene = SceneClass() │ │ > 139 │ │ │ │ scene.render() │ │ 140 │ │ │ except Exception: │ │ 141 │ │ │ │ error_console.print_exception() │ │ 142 │ │ │ │ sys.exit(1) │ │ C:\tools\Manim\Lib\site-packages\manim\scene\scene.py:219 in render │ │ │ │ 216 │ │ """ │ │ 217 │ │ self.setup() │ │ 218 │ │ try: │ │ > 219 │ │ │ self.construct() │ │ 220 │ │ except EndSceneEarlyException: │ │ 221 │ │ │ pass │ │ 222 │ │ except RerunSceneException as e: │ │ │ │ C:\Users\Varun Vasu & Family\Desktop\project\scene.py:58 in construct │ │ │ │ 55 class Vector(VectorScene): │ │ 56 │ def construct(self): │ │ 57 │ │ │ │ > 58 │ │ self.add_axes(animate=True,color=YELLOW) │ │ 59 │ │ │ │ 60 │ │ # self.add_plane(animate=True) │ │ 61 │ │ # BasisVecs=self.get_basis_vectors() │ │ │ │ C:\tools\Manim\Lib\site-packages\manim\scene\vector_space_scene.py:81 in add_axes │ │ │ │ 78 │ │ color : bool, optional │ │ 79 │ │ │ The color of the axes. Defaults to WHITE. │ │ 80 │ │ """ │ │ > 81 │ │ axes = Axes(color=color, tick_frequency=1) │ │ 82 │ │ if animate: │ │ 83 │ │ │ self.play(Create(axes)) │ │ 84 │ │ self.add(axes) │ │ │ │ C:\tools\Manim\Lib\site-packages\manim\mobject\coordinate_systems.py:1831 in __init__ │ │ │ │ 1828 │ │ tips: bool = True, │ │ 1829 │ │ **kwargs, │ │ 1830 │ ): │ │ > 1831 │ │ VGroup.__init__(self, **kwargs) │ │ 1832 │ │ CoordinateSystem.__init__(self, x_range, y_range, x_length, y_length) │ │ 1833 │ │ │ │ 1834 │ │ self.axis_config = { │ │ │ │ C:\tools\Manim\Lib\site-packages\manim\mobject\types\vectorized_mobject.py:1694 in __init__ │ │ │ │ 1691 │ """ │ │ 1692 │ │ │ 1693 │ def __init__(self, *vmobjects, **kwargs): │ │ > 1694 │ │ super().__init__(**kwargs) │ │ 1695 │ │ self.add(*vmobjects) │ │ 1696 │ │ │ 1697 │ def __repr__(self): │ │ │ │ C:\tools\Manim\Lib\site-packages\manim\mobject\types\vectorized_mobject.py:115 in __init__ │ │ │ │ 112 │ │ self.shade_in_3d = shade_in_3d │ │ 113 │ │ self.tolerance_for_point_equality = tolerance_for_point_equality │ │ 114 │ │ self.n_points_per_cubic_curve = n_points_per_cubic_curve │ │ > 115 │ │ super().__init__(**kwargs) │ │ 116 │ │ │ 117 │ def get_group_class(self): │ │ 118 │ │ return VGroup │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ TypeError: __init__() got an unexpected keyword argument 'tick_frequency' ```

System specifications

System Details - OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)): - RAM: - Python version (`python/py/python3 --version`): - Installed modules (provide output from `pip list`): ``` PASTE HERE ```
LaTeX details + LaTeX distribution (e.g. TeX Live 2020): + Installed LaTeX packages:
FFMPEG Output of `ffmpeg -version`: ``` PASTE HERE ```

Additional comments

Viicos commented 2 years ago

If I'm not mistaken VectorScene isn't really used anymore. Try using Axes and NumberPlane objects in a simple Scene.