Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added an example to :class:`~.PGroup` (#1697)

MathInvariance1d7c01c1e73d
diff --git a/manim/mobject/types/point_cloud_mobject.py b/manim/mobject/types/point_cloud_mobject.py
index fe91f21ea..8994b8110 100644
--- a/manim/mobject/types/point_cloud_mobject.py
+++ b/manim/mobject/types/point_cloud_mobject.py
@@ -199,6 +199,27 @@ class Mobject2D(PMobject):
class PGroup(PMobject):
+ """
+ Examples
+ --------
+
+ .. manim:: PgroupExample
+ :save_last_frame:
+
+ class PgroupExample(Scene):
+ def construct(self):
+
+ p1 = PointCloudDot(radius=1, density=20, color=BLUE)
+ p1.move_to(4.5 * LEFT)
+ p2 = PointCloudDot()
+ p3 = PointCloudDot(radius=1.5, stroke_width=2.5, color=PINK)
+ p3.move_to(4.5 * RIGHT)
+ pList = PGroup(p1, p2, p3)
+
+ self.add(pList)
+
+ """
+
def __init__(self, *pmobs, **kwargs):
if not all([isinstance(m, PMobject) for m in pmobs]):
raise ValueError("All submobjects must be of type PMobject")
@@ -208,7 +229,7 @@ class PGroup(PMobject):
class PointCloudDot(Mobject1D):
"""A disc made of a cloud of Dots
- Example
+ Examples
--------
.. manim:: PointCloudDotExample
:save_last_frame: