@@ -49,23 +49,55 @@ Examples to illustrate the use of GrapheScenes in Manim
49
49
for time, dat in enumerate(data):
50
50
dot = Dot().move_to(self.coords_to_point(time, dat))
51
51
self.add(dot)
52
- self.wait(1)
53
- print(time)
54
- self.wait()
55
52
56
53
.. manim :: Plot3bGaussian
57
54
:quality: medium
58
55
:save_last_frame:
59
56
60
57
class Plot3bGaussian(GraphScene):
58
+ global amp
59
+ global mu
60
+ global sig
61
+ amp = 5
62
+ mu = 3
63
+ sig = 1
64
+
65
+ def gaussian(self, x):
66
+ return amp * np.exp((-1 / 2 * ((x - mu) / sig) ** 2))
67
+
61
68
def construct(self):
62
- def gaussian(x):
63
- mu=3; sig= 1; amp=5
64
- return amp*np.exp( ( -1/2 * ( (x-mu)/sig)**2 ) )
65
69
self.setup_axes()
66
- graph = self.get_graph(gaussian, x_min=-1, x_max=10).set_stroke(width=5)
70
+ graph = self.get_graph(self. gaussian, x_min=-1, x_max=10).set_stroke(width=5)
67
71
self.add(graph)
68
72
73
+ .. manim :: Plot3cGaussian
74
+ :quality: medium
75
+ :save_last_frame:
76
+
77
+ class Plot3cGaussian(GraphScene):
78
+ def construct(self):
79
+ def gaussian(x):
80
+ amp = 5
81
+ mu = 3
82
+ sig = 1
83
+ return amp * np.exp((-1 / 2 * ((x - mu) / sig) ** 2))
84
+ self.setup_axes()
85
+ graph = self.get_graph(gaussian, x_min=-1, x_max=10).set_style(stroke_width=5, stroke_color=GREEN)
86
+ self.add(graph)
87
+ global amp
88
+ global mu
89
+ global sig
90
+ amp = 5
91
+ mu = 3
92
+ sig = 1
93
+
94
+ def gaussian(self, x):
95
+ return amp * np.exp((-1 / 2 * ((x - mu) / sig) ** 2))
96
+
97
+ def construct(self):
98
+ self.setup_axes()
99
+ graph = self.get_graph(self.gaussian, x_min=-1, x_max=10).set_stroke(width=5)
100
+ self.a
69
101
.. manim :: Plot4SinCos
70
102
:quality: medium
71
103
:save_last_frame:
@@ -146,7 +178,6 @@ Examples to illustrate the use of GrapheScenes in Manim
146
178
def construct(self):
147
179
data = [20, 0, 0, -5]
148
180
x = [0, 8, 38, 39]
149
- print(x)
150
181
self.setup_axes(animate=True)
151
182
dot_collection = VGroup()
152
183
for time, val in enumerate(data):
0 commit comments