GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Installation
  • Documentation
  • Examples
  • Tutorials
  • Contributing

This view

  • Original page
  • New address

GeezerVison is showing matplotlib.org — matplotlib.pyplot.axvspan — Matplotlib 3.1.2 documentation

You are reading an old version of the documentation (v3.1.1). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.axvspan.html
Version 3.1.2
matplotlib
Fork me on GitHub

Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • contents »
  • API Overview »
  • matplotlib.pyplot »
  • matplotlib.pyplot »

Quick search

Table of Contents

  • matplotlib.pyplot.axvspan
    • Examples using matplotlib.pyplot.axvspan

Related Topics

  • Documentation overview
    • API Overview
      • matplotlib.pyplot
        • matplotlib.pyplot
          • Previous: matplotlib.pyplot.axvline
          • Next: matplotlib.pyplot.bar
Show Page Source

matplotlib.pyplot.axvspan¶

matplotlib.pyplot.axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)[source]¶

Add a vertical span (rectangle) across the axes.

Draw a vertical span (rectangle) from xmin to xmax. With the default values of ymin = 0 and ymax = 1. This always spans the yrange, regardless of the ylim settings, even if you change them, e.g., with the set_ylim() command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the x location is in data coordinates.

Parameters:
xmin : scalar

Number indicating the first X-axis coordinate of the vertical span rectangle in data units.

xmax : scalar

Number indicating the second X-axis coordinate of the vertical span rectangle in data units.

ymin : scalar, optional

Number indicating the first Y-axis coordinate of the vertical span rectangle in relative Y-axis units (0-1). Default to 0.

ymax : scalar, optional

Number indicating the second Y-axis coordinate of the vertical span rectangle in relative Y-axis units (0-1). Default to 1.

Returns:
rectangle : Polygon

Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).

Other Parameters:
**kwargs

Optional parameters are properties of the class Polygon.

See also

axhspan
Add a horizontal span across the axes.

Examples

Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the axes.

>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)

Examples using matplotlib.pyplot.axvspan¶

../../_images/sphx_glr_axhspan_demo_thumb.png

axhspan Demo

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2018 The Matplotlib development team.
Last updated on Jan 05, 2020. Created using Sphinx 1.8.5. Doc version v3.1.1-79-g90d53b526.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.