diff --git a/doc/api/collections_api.rst b/doc/api/collections_api.rst index 8f3f92c4e756..a62dbc0136cf 100644 --- a/doc/api/collections_api.rst +++ b/doc/api/collections_api.rst @@ -12,3 +12,4 @@ collections :members: :undoc-members: :show-inheritance: + :inherited-members: diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index 95e64afedb8d..3683b1b23b48 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -202,6 +202,19 @@ show with an int, slice object, numpy fancy indexing, or float. Using a float shows markers at approximately equal display-coordinate-distances along the line. +Added size related functions to specialized `Collections` +````````````````````````````````````````````````````````` + +Added the `get_size` and `set_size` functions to control the size of +elements of specialized collections ( +:class:`~matplotlib.collections.AsteriskPolygonCollection` +:class:`~matplotlib.collections.BrokenBarHCollection` +:class:`~matplotlib.collections.CircleCollection` +:class:`~matplotlib.collections.PathCollection` +:class:`~matplotlib.collections.PolyCollection` +:class:`~matplotlib.collections.RegularPolyCollection` +:class:`~matplotlib.collections.StarPolygonCollection`). + Fixed the mouse coordinates giving the wrong theta value in Polar graph ``````````````````````````````````````````````````````````````````````` diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 26798b66003b..b573d3bb9e21 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -710,9 +710,30 @@ class _CollectionWithSizes(Collection): Base class for collections that have an array of sizes. """ def get_sizes(self): + """ + Returns the sizes of the elements in the collection. The + value represents the 'area' of the element. + + Returns + ------- + sizes : array + The 'area' of each element. + """ return self._sizes def set_sizes(self, sizes, dpi=72.0): + """ + Set the sizes of each member of the collection. + + Parameters + ---------- + sizes : ndarray or None + The size to set for each element of the collection. The + value is the 'area' of the element. + + dpi : float + The dpi of the canvas. Defaults to 72.0. + """ if sizes is None: self._sizes = np.array([]) self._transforms = np.empty((0, 3, 3))