Skip to content

'include_numbers' displaces objects in coordinate plane #1662

@k4pran

Description

@k4pran

Description of bug / unexpected behavior

In Axes the config include_numbers seems to affect positioning of objects. Position of the vector is as expected when not using include_numbers

class Example2(Scene):

    def construct(self):
        axes = Axes()
        f_vec = Vector(axes.coords_to_point(np.cos(45 * PI / 180), np.sin(45 * PI / 180)))
        f_vec.set_stroke(width=2.0)

        self.add(axes, f_vec)

Example2_ManimCE_v0 6 0

If I change the code to include numbers the vector is now displaced:

class Example2(Scene):

    def construct(self):
        axes = Axes(axis_config={'include_numbers': True})
        f_vec = Vector(axes.coords_to_point(np.cos(45 * PI / 180), np.sin(45 * PI / 180)))
        f_vec.set_stroke(width=2.0)

        self.add(axes, f_vec)

Example2_ManimCE_v0 6 0

Expected behavior

I would expect to be able to change config without it affecting the positions of objects in the coordinate plane that have been resolved with coords_to_point

How to reproduce the issue

Code for reproducing the problem
class Example2(Scene):

    def construct(self):
        axes = Axes(axis_config={'include_numbers': True})
        f_vec = Vector(axes.coords_to_point(np.cos(45 * PI / 180), np.sin(45 * PI / 180)))
        f_vec.set_stroke(width=2.0)

        self.add(axes, f_vec)

Additional media files

Images/GIFs

Example2_ManimCE_v0 6 0

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

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

I am also thinking is there a way of improving the integration of other mobjects into coordinate planes? Such as adding them as submobjects and automatically resolving their position to the correct coordinates?

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions