Repository: ManimCommunity/manim
File: manim/scene/graph_scene.py (Python)

Code before:
        else:
            self.add(*axes)
        self.x_axis, self.y_axis = self.axes = VGroup(x_axis, y_axis)
        self.default_graph_colors = it.cycle(self.default_graph_colors)

    def coords_to_point(self, x, y):
        """The graph is smaller than the scene.

        Because of this, coordinates in the graph don't map
        to coordinates on the scene.

        This method returns a scaled coordinate for the scene,
        given coordinates that correspond to the graph.

        Parameters
        ----------
        x : :class:`float`
            The x coordinate of the graph.

        y : :class:`float`
            The y coordinate of the graph.

        Returns
        -------
        :class:`numpy.ndarray`
            The array of the coordinates on the scene.

        Examples
        --------

        .. manim:: SequencePlot
            :save_last_frame:

            class SequencePlot(GraphScene):
                def __init__(self, **kwargs):
                    GraphScene.__init__(
                        self,
                        y_axis_label=r"Concentration [\%]",
                        x_axis_label="Time [s]",
                        **kwargs
                    )

                def construct(self):
                    data = [1, 2, 2, 4, 4, 1, 3]
                    self.setup_axes()
                    for time, dat in enumerate(data):
                        dot = Dot().move_to(self.coords_to_point(time, dat))
                        self.add(dot)
        """
        assert hasattr(self, "x_axis") and hasattr(self, "y_axis")
        result = self.x_axis.number_to_point(x)[0] * RIGHT

Review comment (suggestion):
```suggestion
            Coordinates of a point in the scene.
```

Code after:
        else:
            self.add(*axes)
        self.x_axis, self.y_axis = self.axes = VGroup(x_axis, y_axis)
        self.default_graph_colors = it.cycle(self.default_graph_colors)

    def coords_to_point(self, x, y):
        """Maps a pair of coordinates (with respect to the axes)
        to a point in the scene.

        The graph is smaller than the scene. Because of this, coordinates
        in the graph don't map to coordinates on the scene.

        This method returns a scaled coordinate for the scene,
        given coordinates that correspond to the graph.

        Parameters
        ----------
        x : :class:`float`
            The x coordinate with respect to the graph.

        y : :class:`float`
            The y coordinate with respect to the graph.

        Returns
        -------
        :class:`numpy.ndarray`
            Coordinates of a point in the scene.

        Examples
        --------

        .. manim:: SequencePlot
            :save_last_frame:

            class SequencePlot(GraphScene):
                def __init__(self, **kwargs):
                    GraphScene.__init__(
                        self,
                        y_axis_label=r"Concentration [\%]",
                        x_axis_label="Time [s]",
                        **kwargs
                    )

                def construct(self):
                    data = [1, 2, 2, 4, 4, 1, 3]
                    self.setup_axes()
                    for time, dat in enumerate(data):
                        dot = Dot().move_to(self.coords_to_point(time, dat))
                        self.add(dot)
        """
        assert hasattr(self, "x_axis") and hasattr(self, "y_axis")