from manim import *
class NumberPlaneStyles(Scene):
    """3.2 background_line_style 控制主网格，faded_line_style 控制被
    faded_line_ratio 拆出来的辅助网格，默认 ratio=1 时看不到淡化线。
    """
    def construct(self):
        title = Text("自定义网格线样式", 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,
            background_line_style=dict(stroke_color=TEAL, stroke_width=4,
                                       stroke_opacity=0.6),
            faded_line_style=dict(stroke_color=GREY, stroke_width=2,
                                  stroke_opacity=0.3),
            faded_line_ratio=2)
        self.play(FadeIn(title), run_time=0.6)
        self.play(FadeIn(plane), run_time=1.8)
        note = Text("青色主网格 + 灰色淡化网格，faded_line_ratio=2",
                    font="STLiti", font_size=22, color=YELLOW).to_edge(DOWN)
        self.play(FadeIn(note), run_time=0.6)
        self.wait(3.2)
