from manim import *
class NumberPlaneBasic(Scene):
    """3.1 基础二维坐标平面。
    x_range / y_range 第三位是网格间隔，x_length / y_length 是屏幕上的显示尺寸；
    坐标轴默认白色、背景网格默认蓝色。add_coordinates() 要在 FadeIn 之前调用。
    """
    def construct(self):
        title = Text("基础二维坐标平面 NumberPlane", font="STLiti", font_size=32).to_edge(UP)
        plane = NumberPlane(x_range=[-7, 7, 1], y_range=[-4, 4, 1],
                            x_length=10, y_length=5.5)
        plane.add_coordinates()
        self.play(FadeIn(title), run_time=0.6)
        self.play(FadeIn(plane), run_time=1.6)
        note = Text("x_range=[-7,7,1]  y_range=[-4,4,1]  网格间隔为 1",
                    font="STLiti", font_size=22, color=YELLOW).to_edge(DOWN)
        self.play(FadeIn(note), run_time=0.6)
        self.wait(3.4)
