Skip to content

Commit 5f84e20

Browse files
authored
Minor Fixes for Example Scenes (#2374)
* Fixed Dot color parameter in example scenes * Automatically create downloads directory if necessary
1 parent e47871f commit 5f84e20

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

docs/source/getting_started/example_scenes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ CoordinateSystemExample
426426
# you can call call axes.coords_to_point, abbreviated to
427427
# axes.c2p, to associate a set of coordinates with a point,
428428
# like so:
429-
dot = Dot(color=RED)
429+
dot = Dot(fill_color=RED)
430430
dot.move_to(axes.c2p(0, 0))
431431
self.play(FadeIn(dot, scale=0.5))
432432
self.play(dot.animate.move_to(axes.c2p(3, 2)))
@@ -537,7 +537,7 @@ GraphExample
537537

538538
# You can use axes.input_to_graph_point, abbreviated
539539
# to axes.i2gp, to find a particular point on a graph
540-
dot = Dot(color=RED)
540+
dot = Dot(fill_color=RED)
541541
dot.move_to(axes.i2gp(2, parabola))
542542
self.play(FadeIn(dot, scale=0.5))
543543

example_scenes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def construct(self):
375375
# you can call call axes.coords_to_point, abbreviated to
376376
# axes.c2p, to associate a set of coordinates with a point,
377377
# like so:
378-
dot = Dot(color=RED)
378+
dot = Dot(fill_color=RED)
379379
dot.move_to(axes.c2p(0, 0))
380380
self.play(FadeIn(dot, scale=0.5))
381381
self.play(dot.animate.move_to(axes.c2p(3, 2)))
@@ -480,7 +480,7 @@ def construct(self):
480480

481481
# You can use axes.input_to_graph_point, abbreviated
482482
# to axes.i2gp, to find a particular point on a graph
483-
dot = Dot(color=RED)
483+
dot = Dot(fill_color=RED)
484484
dot.move_to(axes.i2gp(2, parabola))
485485
self.play(FadeIn(dot, scale=0.5))
486486

manimlib/utils/file_ops.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ def find_file(
2929
extensions: Iterable[str] | None = None
3030
) -> Path:
3131
# Check if this is a file online first, and if so, download
32-
# it to a temporary directory
32+
# it to the configured downloads directory
3333
if validators.url(file_name):
3434
suffix = Path(file_name).suffix
3535
file_hash = hash_string(file_name)
3636
folder = manimlib.utils.directories.get_downloads_dir()
37-
3837
path = Path(folder, file_hash).with_suffix(suffix)
38+
39+
# ensure that the target folder exists before downloading
40+
guarantee_existence(folder)
3941
urllib.request.urlretrieve(file_name, path)
4042
return path
4143

0 commit comments

Comments
 (0)