Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d67b02

Browse files
authored
Merge pull request #22652 from oscargus/seealso
Update documentation example and fix See also
2 parents 27cfec2 + a6445c9 commit 9d67b02

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ An example docstring looks like:
368368

369369
.. code-block:: python
370370
371-
def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
371+
def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
372372
label='', **kwargs):
373373
"""
374374
Plot horizontal lines at each *y* from *xmin* to *xmax*.
@@ -382,24 +382,26 @@ An example docstring looks like:
382382
Respective beginning and end of each line. If scalars are
383383
provided, all lines will have the same length.
384384
385-
colors : array-like of colors, default: 'k'
385+
colors : list of colors, default: :rc:`lines.color`
386386
387-
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
387+
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
388388
389389
label : str, default: ''
390390
391391
Returns
392392
-------
393-
lines : `~matplotlib.collections.LineCollection`
393+
`~matplotlib.collections.LineCollection`
394394
395395
Other Parameters
396396
----------------
397-
**kwargs : `~matplotlib.collections.LineCollection` properties
397+
data : indexable object, optional
398+
DATA_PARAMETER_PLACEHOLDER
399+
**kwargs : `~matplotlib.collections.LineCollection` properties.
398400
399-
See also
401+
See Also
400402
--------
401403
vlines : vertical lines
402-
axhline: horizontal line across the axes
404+
axhline : horizontal line across the Axes
403405
"""
404406
405407
See the `~.Axes.hlines` documentation for how this renders.
@@ -566,10 +568,10 @@ effect.
566568
Sphinx automatically links code elements in the definition blocks of ``See
567569
also`` sections. No need to use backticks there::
568570

569-
See also
571+
See Also
570572
--------
571573
vlines : vertical lines
572-
axhline: horizontal line across the axes
574+
axhline : horizontal line across the Axes
573575

574576
Wrapping parameter lists
575577
~~~~~~~~~~~~~~~~~~~~~~~~

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
10131013
10141014
xmin, xmax : float or array-like
10151015
Respective beginning and end of each line. If scalars are
1016-
provided, all lines will have same length.
1016+
provided, all lines will have the same length.
10171017
10181018
colors : list of colors, default: :rc:`lines.color`
10191019
@@ -1092,7 +1092,7 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
10921092
10931093
ymin, ymax : float or array-like
10941094
Respective beginning and end of each line. If scalars are
1095-
provided, all lines will have same length.
1095+
provided, all lines will have the same length.
10961096
10971097
colors : list of colors, default: :rc:`lines.color`
10981098

0 commit comments

Comments
 (0)