Repository: ManimCommunity/manim
File: manim/mobject/graphing/coordinate_systems.py (Python)

Code before:
        -------
        np.ndarray
            A point with respect to the scene's coordinate system.
            The shape of the array will be similar to the shape of the input.

        Examples
        --------

        .. code-block:: python

            from manim import Axes
            import numpy as np

            ax = Axes()
            np.around(ax.coords_to_point(1, 0, 0), 2)
            # array([0.86, 0.  , 0.  ])
            np.around(ax.coords_to_point([[0, 1], [1, 1], [1, 0]]), 2)
            # array([[0.  , 0.75, 0.  ],
            #        [0.86, 0.75, 0.  ],
            #        [0.86, 0.  , 0.  ]])
            np.around(
                ax.coords_to_point([0, 1, 1], [1, 1, 0]), 2
            )  # Transposed version of the above
            # array([[0.  , 0.86, 0.86],
            #        [0.75, 0.75, 0.  ],
            #        [0.  , 0.  , 0.  ]])

        .. manim:: CoordsToPointExample
            :save_last_frame:

            class CoordsToPointExample(Scene):
                def construct(self):
                    ax = Axes().add_coordinates()

                    # a dot with respect to the axes
                    dot_axes = Dot(ax.coords_to_point(2, 2), color=GREEN)
                    lines = ax.get_lines_to_point(ax.c2p(2,2))

                    # a dot with respect to the scene
                    # the default plane corresponds to the coordinates of the scene.
                    plane = NumberPlane()
                    dot_scene = Dot((2,2,0), color=RED)

                    self.add(plane, dot_scene, ax, dot_axes, lines)
        """
        origin = self.x_axis.number_to_point(
            self._origin_shift([self.x_axis.x_min, self.x_axis.x_max]),
        )

        coords = np.asarray(coords)


Review comment (suggestion):
Is there a particular reason why you decided against writing this as a doctest?

```suggestion
        .. code-block:: python

            >>> from manim import Axes
            >>> import numpy as np
            >>> ax = Axes()
            >>> np.around(ax.coords_to_point(1, 0, 0), 2)
            array([0.86, 0.  , 0.  ])
            >>> np.around(ax.coords_to_point([[0, 1], [1, 1], [1, 0]]), 2)
            array([[0.  , 0.75, 0.  ],
                   [0.86, 0.75, 0.  ],
                   [0.86, 0.  , 0.  ]])
            >>> np.around(
            ...    ax.coords_to_point([0, 1, 1], [1, 1, 0]), 2
            ... )  # Transposed version of the above
            array([[0.  , 0.86, 0.86],
                   [0.75, 0.75, 0.  ],
                   [0.  , 0.  , 0.  ]])
```

Code after:
        -------
        np.ndarray
            A point with respect to the scene's coordinate system.
            The shape of the array will be similar to the shape of the input.

        Examples
        --------

        .. code-block:: pycon

            >>> from manim import Axes
            >>> import numpy as np
            >>> ax = Axes()
            >>> np.around(ax.coords_to_point(1, 0, 0), 2)
            array([0.86, 0.  , 0.  ])
            >>> np.around(ax.coords_to_point([[0, 1], [1, 1], [1, 0]]), 2)
            array([[0.  , 0.75, 0.  ],
                   [0.86, 0.75, 0.  ],
                   [0.86, 0.  , 0.  ]])
            >>> np.around(
            ...     ax.coords_to_point([0, 1, 1], [1, 1, 0]), 2
            ... )  # Transposed version of the above
            array([[0.  , 0.86, 0.86],
                   [0.75, 0.75, 0.  ],
                   [0.  , 0.  , 0.  ]])

        .. manim:: CoordsToPointExample
            :save_last_frame:

            class CoordsToPointExample(Scene):
                def construct(self):
                    ax = Axes().add_coordinates()

                    # a dot with respect to the axes
                    dot_axes = Dot(ax.coords_to_point(2, 2), color=GREEN)
                    lines = ax.get_lines_to_point(ax.c2p(2,2))

                    # a dot with respect to the scene
                    # the default plane corresponds to the coordinates of the scene.
                    plane = NumberPlane()
                    dot_scene = Dot((2,2,0), color=RED)

                    self.add(plane, dot_scene, ax, dot_axes, lines)
        """
        origin = self.x_axis.number_to_point(
            self._origin_shift([self.x_axis.x_min, self.x_axis.x_max]),
        )

        coords = np.asarray(coords)

        # if called like coords_to_point(1, 2, 3), then coords is a 1x3 array