matplotlib 3.5.1

Other ParametersParametersReturns
_fill_between_x_or_y(self, ind_dir, ind, dep1, dep2=0, *, where=None, interpolate=False, step=None, **kwargs)

The curves are defined by the points ({ind}, {dep}1) and ({ind}, {dep}2). This creates one or multiple polygons describing the filled area.

You may exclude some {dir} 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 {ind}.

Other Parameters

data : indexable object, optional

DATA_PARAMETER_PLACEHOLDER

**kwargs :

All other keyword arguments are passed on to .PolyCollection . They control the .Polygon properties:

%(PolyCollection:kwdoc)s

Parameters

{ind} : array (length N)

The {ind} coordinates of the nodes defining the curves.

{dep}1 : array (length N) or scalar

The {dep} coordinates of the nodes defining the first curve.

{dep}2 : array (length N) or scalar, default: 0

The {dep} coordinates of the nodes defining the second curve.

where : array of bool (length N), optional

Define where to exclude some {dir} regions from being filled. The filled regions are defined by the coordinates {ind}[where] . More precisely, fill between {ind}[i] and {ind}[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.

interpolate : bool, default: False

This option is only relevant if where is used and the two curves are crossing each other.

Semantically, where is often used for {dep}1 > {dep}2 or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the {ind} array. Such a polygon cannot describe the above semantics close to the intersection. The {ind}-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.

step : {{'pre', 'post', 'mid'}}, optional

Define step if the filling should be a step function, i.e. constant in between {ind}. The value determines where the step will occur:

  • 'pre': The y value is continued constantly to the left from every x position, i.e. the interval (x[i-1], x[i]] has the value y[i] .

  • 'post': The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i] .

  • 'mid': Steps occur half-way between the x positions.

Returns

`.PolyCollection`

A .PolyCollection containing the plotted polygons.

Fill the area between two {dir} curves.

See Also

fill_between

Fill between two sets of y-values.

fill_betweenx

Fill between two sets of x-values.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/axes/_axes.py#5059
type: <class 'function'>
Commit: