From a5025eddf180d6aa162f79067821208e1d7d4c4d Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 7 Jun 2014 21:53:00 -0400 Subject: [PATCH 1/3] DOC : Added docstrings to _CollectionWithSizes Added docstrings for get_sizes and set_sizes --- lib/matplotlib/collections.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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)) From 25b3af63a96cd23a3235c295717e87b1a272b35b Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 7 Jun 2014 21:53:39 -0400 Subject: [PATCH 2/3] DOC : tweaked Collection api auto-doc properties Include inherited methods (so get_sizes and set_sizes show up) in auto-doc --- doc/api/collections_api.rst | 1 + 1 file changed, 1 insertion(+) 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: From 274f684f67d778b64019a2b7adb5717117cd7388 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 7 Jun 2014 21:54:25 -0400 Subject: [PATCH 3/3] DOC : added whats_new entry for _CollectionWithSizes --- doc/users/whats_new.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 ```````````````````````````````````````````````````````````````````````