Fill the area between two vertical curves.
The curves are defined by the points (y, x1) and (y, x2). This creates one or multiple polygons describing the filled area.
You may exclude some vertical sections from filling using where.
By default, the edges connect the given points directly. Use step if the filling should be a step function, i.e. constant in between y.
The y coordinates of the nodes defining the curves.
The x coordinates of the nodes defining the first curve.
The x coordinates of the nodes defining the second curve.
Define where to exclude some vertical regions from being filled. The filled regions are defined by the coordinates y[where]
. More precisely, fill between y[i]
and y[i+1]
if where[i] and where[i+1]
. Note that this definition implies that an isolated True value between two False values in where will not result in filling. Both sides of the True position remain unfilled due to the adjacent False values.
This option is only relevant if where is used and the two curves are crossing each other.
Semantically, where is often used for x1 > x2 or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the y array. Such a polygon cannot describe the above semantics close to the intersection. The y-sections containing the intersection are simply clipped.
Setting interpolate to True will calculate the actual intersection point and extend the filled region up to this point.
Define step if the filling should be a step function, i.e. constant in between y. The value determines where the step will occur:
(x[i-1], x[i]]
has the value y[i]
.[x[i], x[i+1])
has the value y[i]
.PolyCollection
A PolyCollection
containing the plotted polygons.
If given, the following parameters also accept a string s
, which is interpreted as data[s]
(unless this raises an exception):
y, x1, x2, where
All other keyword arguments are passed on to PolyCollection
. They control the Polygon
properties:
Property | Description |
---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array | |
array-like or scalar or None | |
bool | |
| bool or list of bools |
array-like or None | |
| |
(vmin: float, vmax: float) | |
bool | |
Patch or (Path, Transform) or None | |
| |
color or list of rgba tuples | |
| color or list of colors or 'face' |
| color or list of colors |
str | |
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} | |
bool | |
| |
object | |
| str or tuple or list thereof |
| float or list of floats |
| |
(N, 2) or (2,) array-like | |
list of array-like | |
None or bool or float or callable | |
float | |
bool | |
| ndarray or None |
(scale: float, length: float, randomness: float) | |
bool or None | |
str | |
list of str or None | |
list of array-like | |
unknown | |
bool | |
float |
See also
fill_between
Fill between two sets of y-values.
fill_betweenx
Fill between two sets of x-values.
matplotlib.axes.Axes.fill_betweenx
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axes.Axes.fill_betweenx.html