본문 바로가기

Programming/Manim code

[33]NumberPlane

반응형
plane = NumberPlane()
self.add(plane)
self.wait()

 

 


 

        plane = NumberPlane()

        axes = plane.get_axes()
        x_axis = axes[0]
        y_axis = axes[1]

        print("x_axis:")
        print("  x_min:", x_axis.x_min)
        print("  x_max:", x_axis.x_max)
        print("  unit_size:", x_axis.unit_size)

        print("y_axis:")
        print("  y_min:", y_axis.x_min)
        print("  y_max:", y_axis.x_max)
        print("  unit_size:", y_axis.unit_size)

 

x_axis:
  x_min: -7.111111111111111
  x_max: 7.111111111111111
  unit_size: 1
y_axis:
  y_min: -4.0
  y_max: 4.0
  unit_size: 1

 

 


 

    def sine_graph(self):
        plane = NumberPlane()
        graph = plane.get_graph(
            lambda x: np.sin(x),
            color=YELLOW
        )

        self.add(plane, graph)
        self.wait()

 

반응형

'Programming > Manim code' 카테고리의 다른 글

[37]Animation's rate_func  (0) 2020.05.12
[34]GraphScene  (0) 2020.05.12
[032]Axes  (0) 2020.05.11
[031]NumberLine  (0) 2020.05.11
[030]FunctionGraph  (0) 2020.05.11