8000 Shorten docstrings by removing unneeded :class:/:func: + rewordings. · timhoffm/matplotlib@a829249 · GitHub
[go: up one dir, main page]

Skip to content

Commit a829249

Browse files
committed
Shorten docstrings by removing unneeded :class:/:func: + rewordings.
1 parent 6e8d6e9 commit a829249

File tree

4 files changed

+89
-143
lines changed

4 files changed

+89
-143
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 35 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,14 @@ def inset_locator(ax, renderer):
9696

9797
class Axes(_AxesBase):
9898
"""
99-
The :class:`Axes` contains most of the figure elements:
100-
:class:`~matplotlib.axis.Axis`, :class:`~matplotlib.axis.Tick`,
101-
:class:`~matplotlib.lines.Line2D`, :class:`~matplotlib.text.Text`,
102-
:class:`~matplotlib.patches.Polygon`, etc., and sets the
103-
coordinate system.
104-
105-
The :class:`Axes` instance supports callbacks through a callbacks
106-
attribute which is a :class:`~matplotlib.cbook.CallbackRegistry`
107-
instance. The events you can connect to are 'xlim_changed' and
108-
'ylim_changed' and the callback will be called with func(*ax*)
109-
where *ax* is the :class:`Axes` instance.
99+
The `Axes` contains most of the figure elements: `~.axis.Axis`,
100+
`~.axis.Tick`, `~.lines.Line2D`, `~.text.Text`, `~.patches.Polygon`, etc.,
101+
and sets the coordinate system.
102+
103+
The `Axes` instance supports callbacks through a callbacks attribute which
104+
is a `~.cbook.CallbackRegistry` instance. The events you can connect to
105+
are 'xlim_changed' and 'ylim_changed' and the callback will be called with
106+
func(*ax*) where *ax* is the `Axes` instance.
110107
111108
Attributes
112109
----------
@@ -5967,10 +5964,9 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
59675964
59685965
.. note::
59695966
5970-
``pcolormesh()`` is similar to :func:`~Axes.pcolor`. It's much
5971-
faster and preferred in most cases. For a detailed discussion on
5972-
the differences see
5973-
:ref:`Differences between pcolor() and pcolormesh()
5967+
`~Axes.pcolormesh` is similar to `~Axes.pcolor`. It's much faster
5968+
and preferred in most cases. For a detailed discussion on the
5969+
differences see :ref:`Differences between pcolor() and pcolormesh()
59745970
<differences-pcolor-pcolormesh>`.
59755971
59765972
Parameters
@@ -7951,34 +7947,23 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
79517947
list of the corresponding collection instances created. The
79527948
dictionary has the following keys:
79537949
7954-
- ``bodies``: A list of the
7955-
:class:`matplotlib.collections.PolyCollection` instances
7956-
containing the filled area of each violin.
7950+
- ``bodies``: A list of the `~.collections.PolyCollection`
7951+
instances containing the filled area of each violin.
79577952
7958-
- ``cmeans``: A
7959-
:class:`matplotlib.collections.LineCollection` instance
7960-
created to identify the mean values of each of the
7961-
violin's distribution.
7953+
- ``cmeans``: A `~.collections.LineCollection` instance that marks
7954+
the mean values of each of the violin's distribution.
79627955
7963-
- ``cmins``: A
7964-
:class:`matplotlib.collections.LineCollection` instance
7965-
created to identify the bottom of each violin's
7966-
distribution.
7956+
- ``cmins``: A `~.collections.LineCollection` instance that marks
7957+
the bottom of each violin's distribution.
79677958
7968-
- ``cmaxes``: A
7969-
:class:`matplotlib.collections.LineCollection` instance
7970-
created to identify the top of each violin's
7971-
distribution.
7959+
- ``cmaxes``: A `~.collections.LineCollection` instance that marks
7960+
the top of each violin's distribution.
79727961
7973-
- ``cbars``: A
7974-
:class:`matplotlib.collections.LineCollection` instance
7975-
created to identify the centers of each violin's
7976-
distribution.
7962+
- ``cbars``: A `~.collections.LineCollection` instance that marks
7963+
the centers of each violin's distribution.
79777964
7978-
- ``cmedians``: A
7979-
:class:`matplotlib.collections.LineCollection` instance
7980-
created to identify the median values of each of the
7981-
violin's distribution.
7965+
- ``cmedians``: A `~.collections.LineCollection` instance that
7966+
marks the median values of each of the violin's distribution.
79827967
79837968
Notes
79847969
-----
@@ -8057,35 +8042,23 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
80578042
list of the corresponding collection instances created. The
80588043
dictionary has the following keys:
80598044
8060-
- ``bodies``: A list of the
8061-
:class:`matplotlib.collections.PolyCollection` instances
8062-
containing the filled area of each violin.
8063-
8064-
- ``cmeans``: A
8065-
:class:`matplotlib.collections.LineCollection` instance
8066-
created to identify the mean values of each of the
8067-
violin's distribution.
8045+
- ``bodies``: A list of the `~.collections.PolyCollection`
8046+
instances containing the filled area of each violin.
80688047
8069-
- ``cmins``: A
8070-
:class:`matplotlib.collections.LineCollection` instance
8071-
created to identify the bottom of each violin's
8072-
distribution.
8048+
- ``cmeans``: A `~.collections.LineCollection` instance that marks
8049+
the mean values of each of the violin's distribution.
80738050
8074-
- ``cmaxes``: A
8075-
:class:`matplotlib.collections.LineCollection` instance
8076-
created to identify the top of each violin's
8077-
distribution.
8051+
- ``cmins``: A `~.collections.LineCollection` instance that marks
8052+
the bottom of each violin's distribution.
80788053
8079-
- ``cbars``: A
8080-
:class:`matplotlib.collections.LineCollection` instance
8081-
created to identify the centers of each violin's
8082-
distribution.
8054+
- ``cmaxes``: A `~.collections.LineCollection` instance that marks
8055+
the top of each violin's distribution.
80838056
8084-
- ``cmedians``: A
8085-
:class:`matplotlib.collections.LineCollection` instance
8086-
created to identify the median values of each of the
8087-
violin's distribution.
8057+
- ``cbars``: A `~.collections.LineCollection` instance that marks
8058+
the centers of each violin's distribution.
80888059
8060+
- ``cmedians``: A `~.collections.LineCollection` instance that
8061+
marks the median values of each of the violin's distribution.
80898062
"""
80908063

80918064
# Statistical quantities to be plotted on the violins

lib/matplotlib/patches.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,12 @@ def update_from(self, other):
193193

194194
def get_extents(self):
195195
"""
196-
Return a :class:`~matplotlib.transforms.Bbox` object defining
197-
the axis-aligned extents of the :class:`Patch`.
196+
Return the `Patch`'s axis-aligned extents as a `~.transforms.Bbox`.
198197
"""
199198
return self.get_path().get_extents(self.get_transform())
200199

201200
def get_transform(self):
202-
"""
203-
Return the :class:`~matplotlib.transforms.Transform` applied
204-
to the :class:`Patch`.
205-
"""
201+
"""Return the `~.transforms.Transform` applied to the `Patch`."""
206202
return self.get_patch_transform() + artist.Artist.get_transform(self)
207203

208204
def get_data_transform(self):
@@ -977,8 +973,7 @@ def get_path(self):
977973
Returns
978974
-------
979975
path : Path
980-
The :class:`~matplotlib.path.Path` object for
981-
the polygon
976+
The `~.path.Path` object for the polygon.
982977
"""
983978
return self._path
984979

@@ -1168,8 +1163,7 @@ def __init__(self, x, y, dx, dy, width=1.0, **kwargs):
11681163
Scale factor for the width of the arrow. With a default value of
11691164
1, the tail width is 0.2 and head width is 0.6.
11701165
**kwargs
1171-
Keyword arguments control the :class:`~matplotlib.patches.Patch`
1172-
properties:
1166+
Keyword arguments control the `Patch` properties:
11731167
11741168
%(Patch)s
11751169

lib/matplotlib/spines.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def get_bounds(self):
536536
@classmethod
537537
def linear_spine(cls, axes, spine_type, **kwargs):
538538
"""
539-
(staticmethod) Returns a linear :class:`Spine`.
539+
Returns a linear `Spine`.
540540
"""
541541
# all values of 0.999 get replaced upon call to set_bounds()
542542
if spine_type == 'left':
@@ -558,7 +558,7 @@ def linear_spine(cls, axes, spine_type, **kwargs):
558558
def arc_spine(cls, axes, spine_type, center, radius, theta1, theta2,
559559
**kwargs):
560560
"""
561-
(classmethod) Returns an arc :class:`Spine`.
561+
Returns an arc `Spine`.
562562
"""
563563
path = mpath.Path.arc(theta1, theta2)
564564
result = cls(axes, spine_type, path, **kwargs)
@@ -568,7 +568,7 @@ def arc_spine(cls, axes, spine_type, center, radius, theta1, theta2,
568568
@classmethod
569569
def circular_spine(cls, axes, center, radius, **kwargs):
570570
"""
571-
(staticmethod) Returns a circular :class:`Spine`.
571+
Returns a circular `Spine`.
572572
"""
573573
path = mpath.Path.unit_circle()
574574
spine_type = 'circle'

0 commit comments

Comments
 (0)
0