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

Skip to content

Commit 7d0be18

Browse files
authored
Merge pull request #7267 from NelleV/wiolcia_master
DOC: changed documentation for axvspan to numpydoc format
2 parents 5c7ddee + 0bc77dc commit 7d0be18

File tree

1 file changed

+34
-23
lines changed

1 file changed

+34
-23
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -862,39 +862,50 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
862862
"""
863863
Add a vertical span (rectangle) across the axes.
864864
865-
Call signature::
866-
867-
axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)
868-
869-
*x* coords are in data units and *y* coords are in axes (relative
870-
0-1) units.
871-
872-
Draw a vertical span (rectangle) from *xmin* to *xmax*. With
873-
the default values of *ymin* = 0 and *ymax* = 1, this always
865+
Draw a vertical span (rectangle) from `xmin` to `xmax`. With
866+
the default values of `ymin` = 0 and `ymax` = 1. This always
874867
spans the yrange, regardless of the ylim settings, even if you
875868
change them, e.g., with the :meth:`set_ylim` command. That is,
876869
the vertical extent is in axes coords: 0=bottom, 0.5=middle,
877-
1.0=top but the *y* location is in data coordinates.
878-
879-
Return value is the :class:`matplotlib.patches.Polygon`
880-
instance.
870+
1.0=top but the y location is in data coordinates.
881871
882-
Examples:
872+
Parameters
873+
----------
874+
xmin : scalar
875+
Number indicating the first X-axis coordinate of the vertical
876+
span rectangle in data units.
877+
xmax : scalar
878+
Number indicating the second X-axis coordinate of the vertical
879+
span rectangle in data units.
880+
ymin : scalar, optional
881+
Number indicating the first Y-axis coordinate of the vertical
882+
span rectangle in relative Y-axis units (0-1). Default to 0.
883+
ymax : scalar, optional
884+
Number indicating the second Y-axis coordinate of the vertical
885+
span rectangle in relative Y-axis units (0-1). Default to 1.
883886
884-
* draw a vertical green translucent rectangle from x=1.25 to 1.55 that
885-
spans the yrange of the axes::
887+
Returns
888+
-------
889+
rectangle : matplotlib.patches.Polygon
890+
Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).
886891
887-
>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
892+
Other Parameters
893+
----------------
894+
**kwargs
895+
Optional parameters are properties of the class
896+
matplotlib.patches.Polygon.
888897
889-
Valid kwargs are :class:`~matplotlib.patches.Polygon`
890-
properties:
898+
See Also
899+
--------
900+
axhspan
891901
892-
%(Polygon)s
902+
Examples
903+
--------
904+
Draw a vertical, green, translucent rectangle from x = 1.25 to
905+
x = 1.55 that spans the yrange of the axes.
893906
894-
.. seealso::
907+
>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
895908
896-
:meth:`axhspan`
897-
for example plot and source code
898909
"""
899910
trans = self.get_xaxis_transform(which='grid')
900911

0 commit comments

Comments
 (0)