A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.fill_between.html below:

matplotlib.pyplot.fill_between — Matplotlib 3.10.3 documentation

matplotlib.pyplot.fill_between#
matplotlib.pyplot.fill_between(x, y1, y2=0, where=None, interpolate=False, step=None, *, data=None, **kwargs)[source]#

Fill the area between two horizontal curves.

The curves are defined by the points (x, y1) and (x, y2). This creates one or multiple polygons describing the filled area.

You may exclude some horizontal 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 x.

Parameters:
xarray-like

The x coordinates of the nodes defining the curves.

y1array-like or float

The y coordinates of the nodes defining the first curve.

y2array-like or float, default: 0

The y coordinates of the nodes defining the second curve.

wherearray-like of bool, optional

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

interpolatebool, 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 y1 > y2 or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the x array. Such a polygon cannot describe the above semantics close to the intersection. The x-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 x. 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:
FillBetweenPolyCollection

A FillBetweenPolyCollection containing the plotted polygons.

Other Parameters:
dataindexable object, optional

If given, the following parameters also accept a string s, which is interpreted as data[s] if s is a key in data:

x, y1, y2, where

**kwargs

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

Notes

Examples using matplotlib.pyplot.fill_between#

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4