@@ -385,41 +385,36 @@ def axhspan(ax, ymin, ymax, xmin=0, xmax=1, **kwargs):
385
385
386
386
def axvspan (ax , xmin , xmax , ymin = 0 , ymax = 1 , ** kwargs ):
387
387
"""
388
- Add a vertical span (rectangle) across the axes .
388
+ Draws a vertical span (rectangle) across the axis .
389
389
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
+ ----------
406
392
407
- Examples:
393
+ xmin, xmax : scalars
394
+ Coordinates in data units of the vertical span.
408
395
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).
411
400
412
- >>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
401
+ Returns
402
+ -------
403
+ polygon : `~matplotlib.patches.Polygon`
413
404
414
- Valid kwargs are :class:`~matplotlib.patches.Polygon`
415
- properties:
405
+ Notes
406
+ -----
407
+ Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:
416
408
417
409
%(Polygon)s
418
410
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::
420
415
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)
423
418
"""
424
419
trans = mtransforms .blended_transform_factory (
425
420
ax .transData , ax .transAxes )
0 commit comments