healpy.projaxes.CartesianAxes.axhspan

CartesianAxes.axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)

Add a horizontal span (rectangle) across the axis.

Call signature:

axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)

y coords are in data units and x coords are in axes (relative 0-1) units.

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.

Return value is a matplotlib.patches.Polygon instance.

Examples:

  • draw a gray rectangle from y = 0.25-0.75 that spans the horizontal extent of the axes:

    >>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
    

Valid kwargs are Polygon properties:

agg_filter: unknown alpha: float or None animated: [True | False] antialiased or aa: [True | False] or None for default axes: an Axes instance clip_box: a matplotlib.transforms.Bbox instance clip_on: [True | False] clip_path: [ (Path, Transform) | Patch | None ] color: matplotlib color spec contains: a callable function edgecolor or ec: mpl color spec, or None for default, or ‘none’ for no color facecolor or fc: mpl color spec, or None for default, or ‘none’ for no color figure: a matplotlib.figure.Figure instance fill: [True | False] gid: an id string hatch: [‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’] label: string or anything printable with ‘%s’ conversion. linestyle or ls: [‘solid’ | ‘dashed’ | ‘dashdot’ | ‘dotted’] linewidth or lw: float or None for default lod: [True | False] path_effects: unknown picker: [None|float|boolean|callable] rasterized: [True | False | None] sketch_params: unknown snap: unknown transform: Transform instance url: a url string visible: [True | False] zorder: any number

Example: