Skip to content

Commit

Permalink
Merge pull request #3130 from tacaswell/scatter_set_sizes_whats_new
Browse files Browse the repository at this point in the history
Scatter set sizes whats new
  • Loading branch information
pelson committed Jun 9, 2014
2 parents afac922 + 274f684 commit e0813ce
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/api/collections_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ collections
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
13 changes: 13 additions & 0 deletions doc/users/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
```````````````````````````````````````````````````````````````````````
Expand Down
21 changes: 21 additions & 0 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e0813ce

Please sign in to comment.