Skip to content

Instantly share code, notes, and snippets.

@EteimZ
Created August 14, 2024 03:30
Show Gist options
  • Save EteimZ/b8a1a3b3ba46705c777c07fb93b8e2ce to your computer and use it in GitHub Desktop.
Save EteimZ/b8a1a3b3ba46705c777c07fb93b8e2ce to your computer and use it in GitHub Desktop.
from manim import *
class SimpleFrequency(Scene):
def construct(self):
ax = Axes(
x_range=[-10, 10.3, 1],
y_range=[-1.5, 1.5, 1],
x_length=10,
x_axis_config={
"numbers_to_include": np.arange(-10, 10.01, 2)
}
)
graph_1 = ax.plot(lambda x : np.sin(x), color=GREEN)
graph_2 = ax.plot(lambda x : np.sin(2 * x), color=RED)
graph_group = VGroup(graph_1, graph_2)
graph_3 = ax.plot(lambda x : np.sin(2 * x) + np.sin(x), color=RED)
self.play(Create(ax))
self.play(Create(graph_group), run_time=2)
self.play(Transform(graph_group, graph_3), run_time=3)
self.wait(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment