Skip to content

Commit d3ebf62

Browse files
committed
# adjusted gaussian example, that is outside the Scene class
1 parent cbaead8 commit d3ebf62

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

docs/source/examples/plots_examples.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,17 @@ Examples to illustrate the use of GrapheScenes in Manim
5454
:quality: medium
5555
:save_last_frame:
5656

57-
class Plot3bGaussian(GraphScene):
58-
global amp
59-
global mu
60-
global sig
61-
amp = 5
62-
mu = 3
63-
sig = 1
57+
amp = 5
58+
mu = 3
59+
sig = 1
6460

65-
def gaussian(self, x):
66-
return amp * np.exp((-1 / 2 * ((x - mu) / sig) ** 2))
61+
def gaussian(x):
62+
return amp * np.exp((-1 / 2 * ((x - mu) / sig) ** 2))
6763

64+
class Plot3bGaussian(GraphScene):
6865
def construct(self):
6966
self.setup_axes()
70-
graph = self.get_graph(self.gaussian, x_min=-1, x_max=10).set_stroke(width=5)
67+
graph = self.get_graph(gaussian, x_min=-1, x_max=10).set_stroke(width=5)
7168
self.add(graph)
7269

7370
.. manim:: Plot3cGaussian

0 commit comments

Comments
 (0)