matplotlib

Travis-CI:

This Page

matplotlib.axes.Axes.fill_betweenx

Axes.fill_betweenx(y, x1, x2=0, where=None, step=None, **kwargs)

Make filled polygons between two horizontal curves.

Call signature:

fill_betweenx(y, x1, x2=0, where=None, **kwargs)

Create a PolyCollection filling the regions between x1 and x2 where where==True

Parameters:

y : array

An N-length array of the y data

x1 : array

An N-length array (or scalar) of the x data

x2 : array, optional

An N-length array (or scalar) of the x data

where : array, optional

If None, default to fill between everywhere. If not None, it is a N length numpy boolean array and the fill will only happen over the regions where where==True

step : {‘pre’, ‘post’, ‘mid’}, optional

If not None, fill with step logic.

Notes

In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]:

  • All arguments with the following names: ‘where’, ‘x1’, ‘x2’, ‘y’.

Examples

(Source code)

../../_images/fill_betweenx_demo_00.png

(png, pdf)

../../_images/fill_betweenx_demo_01.png

(png, pdf)