On this page
matplotlib.pyplot.axhspan
matplotlib.pyplot.axhspan(ymin, ymax, xmin=0, xmax=1, hold=None, **kwargs)[source]-
Add a horizontal span (rectangle) across the axis.
Draw a horizontal span (rectangle) from ymin to ymax. With the default values of xmin = 0 and xmax = 1, this always spans the xrange, regardless of the xlim settings, even if you change them, e.g., with the
set_xlim()command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the y location is in data coordinates.Parameters: -
ymin : float -
Lower limit of the horizontal span in data units.
-
ymax : float -
Upper limit of the horizontal span in data units.
-
xmin : float, optional, default: 0 -
Lower limit of the vertical span in axes (relative 0-1) units.
-
xmax : float, optional, default: 1 -
Upper limit of the vertical span in axes (relative 0-1) units.
Returns: -
Polygon : Polygon
Other Parameters: -
**kwargs : Polygon properties. -
Property Description agg_filtera filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alphafloat or None animatedbool antialiasedor aabool or None capstyle['butt' | 'round' | 'projecting'] clip_boxa Bboxinstanceclip_onbool clip_path[( Path,Transform) |Patch| None]colormatplotlib color spec containsa callable function edgecoloror ecmpl color spec, None, 'none', or 'auto' facecoloror fcmpl color spec, or None for default, or 'none' for no color figurea Figureinstancefillbool gidan id string hatch['/' | '\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*'] joinstyle['miter' | 'round' | 'bevel'] labelobject linestyleor ls['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) | '-'|'--'|'-.'|':'|'None'|' '|'']linewidthor lwfloat or None for default path_effectsAbstractPathEffectpicker[None | bool | float | callable] rasterizedbool or None sketch_params(scale: float, length: float, randomness: float) snapbool or None transformTransformurla url string visiblebool zorderfloat
See also
axvspan- Add a vertical span across the axes.
-
Examples using matplotlib.pyplot.axhspan
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/2.2.3/api/_as_gen/matplotlib.pyplot.axhspan.html