@@ -1051,30 +1051,44 @@ class PolyCollection(_CollectionWithSizes):
10511051 @docstring .dedent_interpd
10521052 def __init__ (self , verts , sizes = None , closed = True , ** kwargs ):
10531053 """
1054- *verts* is a sequence of ( *verts0*, *verts1*, ...) where
1055- *verts_i* is a sequence of *xy* tuples of vertices, or an
1056- equivalent :mod:`numpy` array of shape (*nv*, 2).
1057-
1058- *sizes* is *None* (default) or a sequence of floats that
1059- scale the corresponding *verts_i*. The scaling is applied
1060- before the Artist master transform; if the latter is an identity
1061- transform, then the overall scaling is such that if
1062- *verts_i* specify a unit square, then *sizes_i* is the area
1063- of that square in points^2.
1064- If len(*sizes*) < *nv*, the additional values will be
1065- taken cyclically from the array.
1066-
1067- *closed*, when *True*, will explicitly close the polygon.
1068-
1069- %(Collection)s
1054+ Parameters
1055+ ----------
1056+ verts : sequence
1057+ The sequence of polygons [*verts0*, *verts1*, ...] where each
1058+ element *verts_i* defines the vertices of polygon *i* as a 2D
1059+ array-like of of shape (M, 2).
1060+ sizes : array-like, default: None
1061+ Squared scaling factors for the polygons. The coordinates of each
1062+ polygon *verts_i* are multiplied by the square-root of the
1063+ corresponding entry in *sizes* (i.e., *sizes* specify the scaling
1064+ of areas). The scaling is applied before the Artist master
1065+ transform. If *sizes* is shorter than *verts*, the additional
1066+ values will be taken cyclically from the *sizes*.
1067+ closed : bool, default: True
1068+ Whether the polygon should be closed by adding a CLOSEPOLY
1069+ connection at the end.
1070+ **kwargs
1071+ %(Collection)s
10701072 """
10711073 Collection .__init__ (self , ** kwargs )
10721074 self .set_sizes (sizes )
10731075 self .set_verts (verts , closed )
10741076 self .stale = True
10751077
10761078 def set_verts (self , verts , closed = True ):
1077- '''This allows one to delay initialization of the vertices.'''
1079+ """
1080+ Set the vertices of the polygons.
1081+
1082+ Parameters
1083+ ----------
1084+ verts : sequence
1085+ The sequence of polygons [*verts0*, *verts1*, ...] where each
1086+ element *verts_i* defines the vertices of polygon *i* as a 2D
1087+ array-like of of shape (M, 2).
1088+ closed : bool, default: True
1089+ Whether the polygon should be closed by adding a CLOSEPOLY
1090+ connection at the end.
1091+ """
10781092 if isinstance (verts , np .ma .MaskedArray ):
10791093 verts = verts .astype (float ).filled (np .nan )
10801094 # This is much faster than having Path do it one at a time.
@@ -1122,13 +1136,14 @@ class BrokenBarHCollection(PolyCollection):
11221136 @docstring .dedent_interpd
11231137 def __init__ (self , xranges , yrange , ** kwargs ):
11241138 """
1125- *xranges*
1126- sequence of (*xmin*, *xwidth*)
1127-
1128- *yrange*
1129- *ymin*, *ywidth*
1130-
1131- %(Collection)s
1139+ Parameters
1140+ ----------
1141+ xranges : sequence of (float, float)
1142+ The sequence of (left-edge-position, width) pairs for each bar.
1143+ yrange : (float, float)
1144+ The (lower-edge, height) common to all bars.
1145+ **kwargs
1146+ %(Collection)s
11321147 """
11331148 ymin , ywidth = yrange
11341149 ymax = ymin + ywidth
@@ -1162,7 +1177,7 @@ def span_where(x, ymin, ymax, where, **kwargs):
11621177
11631178
11641179class RegularPolyCollection (_CollectionWithSizes ):
1165- """Draw a collection of regular polygons with *numsides* ."""
1180+ """A collection of n-sided regular polygons."""
11661181
11671182 _path_generator = mpath .Path .unit_regular_polygon
11681183 _factor = np .pi ** (- 1 / 2 )
@@ -1174,20 +1189,24 @@ def __init__(self,
11741189 sizes = (1 ,),
11751190 ** kwargs ):
11761191 """
1177- *numsides*
1178- the number of sides of the polygon
1179-
1180- *rotation*
1181- the rotation of the polygon in radians
1182-
1183- *sizes*
1184- gives the area of the circle circumscribing the
1185- regular polygon in points^2
1192+ Parameters
1193+ ----------
1194+ numsides : int
1195+ The number of sides of the polygon.
1196+ rotation : float
1197+ The rotation of the polygon in radians.
1198+ sizes : tuple of float
1199+ The area of the circle circumscribing the polygon in points^2.
11861200
1187- %(Collection)s
1201+ Other Parameters
1202+ ----------------
1203+ **kwargs
1204+ Other keyword arguments.
1205+ %(Collection)s
11881206
1189- Example: see :doc:`/gallery/event_handling/lasso_demo` for a
1190- complete example::
1207+ Examples
1208+ --------
1209+ See :doc:`/gallery/event_handling/lasso_demo` for a complete example::
11911210
11921211 offsets = np.random.rand(20, 2)
11931212 facecolors = [cm.jet(x) for x in np.random.rand(20)]
0 commit comments