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

Skip to content

Commit a9e035b

Browse files
committed
MEP10 moved axvspan's doc to numpydoc
1 parent eedb3c3 commit a9e035b

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

lib/matplotlib/axes/_lines.py

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -385,41 +385,36 @@ def axhspan(ax, ymin, ymax, xmin=0, xmax=1, **kwargs):
385385

386386
def axvspan(ax, xmin, xmax, ymin=0, ymax=1, **kwargs):
387387
"""
388-
Add a vertical span (rectangle) across the axes.
388+
Draws a vertical span (rectangle) across the axis.
389389
390-
Call signature::
391-
392-
axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)
393-
394-
*x* coords are in data units and *y* coords are in axes (relative
395-
0-1) units.
396-
397-
Draw a vertical span (rectangle) from *xmin* to *xmax*. With
398-
the default values of *ymin* = 0 and *ymax* = 1, this always
399-
spans the yrange, regardless of the ylim settings, even if you
400-
change them, e.g., with the :meth:`set_ylim` command. That is,
401-
the vertical extent is in axes coords: 0=bottom, 0.5=middle,
402-
1.0=top but the *y* location is in data coordinates.
403-
404-
Return value is the :class:`matplotlib.patches.Polygon`
405-
instance.
390+
Parameters
391+
----------
406392
407-
Examples:
393+
xmin, xmax : scalars
394+
Coordinates in data units of the vertical span.
408395
409-
* draw a vertical green translucent rectangle from x=1.25 to 1.55 that
410-
spans the yrange of the axes::
396+
ymin, ymax: scalars, optional, default: 0, 1
397+
Coordinates in relative axes coordinates. 0 is bottom, 0.5 is the
398+
middle and 1 is top. This always spans the xrange, regardless of the
399+
xlim settings (even if you change them with the `set_xlim` method).
411400
412-
>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
401+
Returns
402+
-------
403+
polygon : `~matplotlib.patches.Polygon`
413404
414-
Valid kwargs are :class:`~matplotlib.patches.Polygon`
415-
properties:
405+
Notes
406+
-----
407+
Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:
416408
417409
%(Polygon)s
418410
419-
.. seealso::
411+
Examples
412+
---------
413+
- draws a vertical green translucent rectangle from x=1.25 to 1.55 that
414+
spans the yrange of the axes::
420415
421-
:meth:`axhspan`
422-
for example plot and source code
416+
>>> from matplotlib import pyplot as plt
417+
>>> plt.axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
423418
"""
424419
trans = mtransforms.blended_transform_factory(
425420
ax.transData, ax.transAxes)

0 commit comments

Comments
 (0)