@@ -123,13 +123,13 @@ from manimlib.imports import *
123
123
124
124
class Shapes (Scene ):
125
125
def construct (self ):
126
- # #####Code######
127
- # Making shapes
126
+ # ##### Code ######
127
+ # Making shapes
128
128
circle = Circle()
129
129
square = Square()
130
130
triangle= Polygon(np.array([0 ,0 ,0 ]),np.array([1 ,1 ,0 ]),np.array([1 ,- 1 ,0 ]))
131
131
132
- # Showing shapes
132
+ # Showing shapes
133
133
self .play(ShowCreation(circle))
134
134
self .play(FadeOut(circle))
135
135
self .play(GrowFromCenter(square))
@@ -160,8 +160,8 @@ from math import cos, sin, pi
160
160
161
161
class Shapes (Scene ):
162
162
def construct (self ):
163
- # ######Code#######
164
- # Making Shapes
163
+ # ###### Code #######
164
+ # Making Shapes
165
165
circle = Circle(color = YELLOW )
166
166
square = Square(color = DARK_BLUE )
167
167
square.surround(circle)
@@ -176,7 +176,7 @@ class Shapes(Scene):
176
176
for i in range (8 ):
177
177
pointers.append(Line(ORIGIN , np.array([cos(pi/ 180 * 360 / 8 * i),sin(pi/ 180 * 360 / 8 * i), 0 ]),color = YELLOW ))
178
178
179
- # Showing animation
179
+ # Showing animation
180
180
self .add(circle)
181
181
self .play(FadeIn(square))
182
182
self .play(Transform(square, rectangle))
@@ -243,20 +243,20 @@ from manimlib.imports import *
243
243
244
244
class makeText (Scene ):
245
245
def construct (self ):
246
- # ######Code#######
247
- # Making text
246
+ # ###### Code #######
247
+ # Making text
248
248
first_line = TextMobject(" Manim is fun" )
249
249
second_line = TextMobject(" and useful" )
250
250
final_line = TextMobject(" Hope you like it too!" , color = BLUE )
251
251
color_final_line = TextMobject(" Hope you like it too!" )
252
252
253
- # Coloring
253
+ # Coloring
254
254
color_final_line.set_color_by_gradient(BLUE ,PURPLE )
255
255
256
- # Position text
256
+ # Position text
257
257
second_line.next_to(first_line, DOWN )
258
258
259
- # Showing text
259
+ # Showing text
260
260
self .wait(1 )
261
261
self .play(Write(first_line), Write(second_line))
262
262
self .wait(1 )
@@ -284,7 +284,7 @@ from manimlib.imports import *
284
284
285
285
class Equations (Scene ):
286
286
def construct (self ):
287
- # Making equations
287
+ # Making equations
288
288
first_eq = TextMobject(" $$J(\\ theta) = -\\ frac{1}{m} [\\ sum_{i=1}^{m} y^{(i)} \\ log{h_{\\ theta}(x^{(i)})} + (1-y^{(i)}) \\ log{(1-h_{\\ theta}(x^{(i)}))}] $$" )
289
289
second_eq = [" $J(\\ theta_{0} , \\ theta_{1} )$" , " =" , " $\\ frac{1}{2m} $" , " $\\ sum\\ limits_{i=1}^m$" , " (" , " $h_{\\ theta}(x^{(i)})$" , " -" , " $y^{(i)}$" , " $)^2$" ]
290
290
@@ -300,14 +300,14 @@ class Equations(Scene):
300
300
des2 = TextMobject(" Or this..." )
301
301
des3 = TextMobject(" And it looks nice!!" )
302
302
303
- # Coloring equations
303
+ # Coloring equations
304
304
second_mob.set_color_by_gradient(" #33ccff" ," #ff00ff" )
305
305
306
306
# Positioning equations
307
307
des1.shift(2 * UP )
308
308
des2.shift(2 * UP )
309
309
310
- # Animating equations
310
+ # Animating equations
311
311
self .play(Write(des1))
312
312
self .play(Write(first_eq))
313
313
self .play(ReplacementTransform(des1, des2), Transform(first_eq, eq2))
@@ -413,7 +413,7 @@ class Graphing(GraphScene):
413
413
414
414
point = Dot(self .coords_to_point(1 ,self .func_to_graph(1 )))
415
415
416
- # Display graph
416
+ # Display graph
417
417
self .play(ShowCreation(func_graph), Write(graph_lab))
418
418
self .wait(1 )
419
419
self .play(ShowCreation(vert_line))
@@ -432,37 +432,37 @@ class Graphing(GraphScene):
432
432
```
433
433
434
434
435
- Here is the default dictionary Manim uses for graphing.
436
- ``` python
435
+ Here is the default dictionary Manim uses for graphing. Refer to [ ` manimlib/scene/graph_scene.py ` ] [ graph_scene_src ]
437
436
437
+ [ graph_scene_src ] : https://github.com/3b1b/manim/blob/master/manimlib/scene/graph_scene.py`
438
+ ``` python
438
439
CONFIG = {
439
- " x_min" : - 1 ,
440
- " x_max" : 10 ,
441
- " x_axis_width" : 9 ,
442
- " x_tick_frequency" : 1 ,
443
- " x_leftmost_tick" : None , # Change if different from x_min
444
- " x_labeled_nums" : None ,
445
- " x_axis_label" : " $x$" ,
446
- " y_min" : - 1 ,
447
- " y_max" : 10 ,
448
- " y_axis_height" : 6 ,
449
- " y_tick_frequency" : 1 ,
450
- " y_bottom_tick" : None , # Change if different from y_min
451
- " y_labeled_nums" : None ,
452
- " y_axis_label" : " $y$" ,
453
- " axes_color" : GREY ,
454
- " graph_origin" : 2.5 * DOWN + 4 * LEFT ,
455
- " exclude_zero_label" : True ,
456
- " num_graph_anchor_points" : 25 ,
457
- " default_graph_colors" : [BLUE , GREEN , YELLOW ],
458
- " default_derivative_color" : GREEN ,
459
- " default_input_color" : YELLOW ,
460
- " default_riemann_start_color" : BLUE ,
461
- " default_riemann_end_color" : GREEN ,
462
- " area_opacity" : 0.8 ,
463
- " num_rects" : 50 ,
440
+ " x_min" : - 1 ,
441
+ " x_max" : 10 ,
442
+ " x_axis_width" : 9 ,
443
+ " x_tick_frequency" : 1 ,
444
+ " x_leftmost_tick" : None , # Change if different from x_min
445
+ " x_labeled_nums" : None ,
446
+ " x_axis_label" : " $x$" ,
447
+ " y_min" : - 1 ,
448
+ " y_max" : 10 ,
449
+ " y_axis_height" : 6 ,
450
+ " y_tick_frequency" : 1 ,
451
+ " y_bottom_tick" : None , # Change if different from y_min
452
+ " y_labeled_nums" : None ,
453
+ " y_axis_label" : " $y$" ,
454
+ " axes_color" : GREY ,
455
+ " graph_origin" : 2.5 * DOWN + 4 * LEFT ,
456
+ " exclude_zero_label" : True ,
457
+ " num_graph_anchor_points" : 25 ,
458
+ " default_graph_colors" : [BLUE , GREEN , YELLOW ],
459
+ " default_derivative_color" : GREEN ,
460
+ " default_input_color" : YELLOW ,
461
+ " default_riemann_start_color" : BLUE ,
462
+ " default_riemann_end_color" : GREEN ,
463
+ " area_opacity" : 0.8 ,
464
+ " num_rects" : 50 ,
464
465
}
465
-
466
466
```
467
467
468
468
@@ -529,8 +529,8 @@ from manimlib.imports import *
529
529
class Images (Scene ):
530
530
def construct (self ):
531
531
img = ImageMobject(' pathToIm.png' )
532
- img.scale(2 ) # Resize to be twice as big
533
- img.shift(2 * UP ) # Move the image
532
+ img.scale(2 ) # Resize to be twice as big
533
+ img.shift(2 * UP ) # Move the image
534
534
535
535
self .play(ShowCreation(img)) # Display the image
536
536
```
0 commit comments