Skip to content

Commit e0813ce

Browse files
committed
Merge pull request #3130 from tacaswell/scatter_set_sizes_whats_new
Scatter set sizes whats new
2 parents afac922 + 274f684 commit e0813ce

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

doc/api/collections_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ collections
1212
:members:
1313
:undoc-members:
1414
:show-inheritance:
15+
:inherited-members:

doc/users/whats_new.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,19 @@ show with an int, slice object, numpy fancy indexing, or float. Using a float
202202
shows markers at approximately equal display-coordinate-distances along the
203203
line.
204204

205+
Added size related functions to specialized `Collections`
206+
`````````````````````````````````````````````````````````
207+
208+
Added the `get_size` and `set_size` functions to control the size of
209+
elements of specialized collections (
210+
:class:`~matplotlib.collections.AsteriskPolygonCollection`
211+
:class:`~matplotlib.collections.BrokenBarHCollection`
212+
:class:`~matplotlib.collections.CircleCollection`
213+
:class:`~matplotlib.collections.PathCollection`
214+
:class:`~matplotlib.collections.PolyCollection`
215+
:class:`~matplotlib.collections.RegularPolyCollection`
216+
:class:`~matplotlib.collections.StarPolygonCollection`).
217+
205218

206219
Fixed the mouse coordinates giving the wrong theta value in Polar graph
207220
```````````````````````````````````````````````````````````````````````

lib/matplotlib/collections.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,30 @@ class _CollectionWithSizes(Collection):
710710
Base class for collections that have an array of sizes.
711711
"""
712712
def get_sizes(self):
713+
"""
714+
Returns the sizes of the elements in the collection. The
715+
value represents the 'area' of the element.
716+
717+
Returns
718+
-------
719+
sizes : array
720+
The 'area' of each element.
721+
"""
713722
return self._sizes
714723

715724
def set_sizes(self, sizes, dpi=72.0):
725+
"""
726+
Set the sizes of each member of the collection.
727+
728+
Parameters
729+
----------
730+
sizes : ndarray or None
731+
The size to set for each element of the collection. The
732+
value is the 'area' of the element.
733+
734+
dpi : float
735+
The dpi of the canvas. Defaults to 72.0.
736+
"""
716737
if sizes is None:
717738
self._sizes = np.array([])
718739
self._transforms = np.empty((0, 3, 3))

0 commit comments

Comments
 (0)