from manim import *
class PolarPlaneBasic(Scene):
    """3.1 基本极坐标平面。
    add_coordinates() 返回 self，且必须在 FadeIn 之前调用，
    否则后加的刻度标签不在已上屏的组里，观众看不到。
    """
    def construct(self):
        title = Text("基本极坐标平面 PolarPlane", font="STLiti", font_size=34).to_edge(UP)
        plane = PolarPlane(size=5.6, radius_max=4.0, azimuth_step=8,
                           azimuth_label_font_size=20)
        plane.add_coordinates()
        self.play(FadeIn(title), run_time=0.6)
        self.play(FadeIn(plane), run_time=1.6)
        note = Text("先 add_coordinates() 再上屏，同心圆与角度刻度才会一起显示",
                    font="STLiti", font_size=22, color=YELLOW).to_edge(DOWN)
        self.play(FadeIn(note), run_time=0.6)
        self.wait(3.4)
