mpl_toolkits.mplot3d.axes3d.Axes3D.fill_between#

Axes3D.fill_between(x1, y1, z1, x2, y2, z2, *, where=None, mode='auto', facecolors=None, shade=None, axlim_clip=False, **kwargs)[source]#

Fill the area between two 3D curves.

The curves are defined by the points (x1, y1, z1) and (x2, y2, z2). This creates one or multiple quadrangle polygons that are filled. All points must be the same length N, or a single value to be used for all points.

Parameters:
x1, y1, z1float or 1D array-like

x, y, and z coordinates of vertices for 1st line.

x2, y2, z2float or 1D array-like

x, y, and z coordinates of vertices for 2nd line.

wherearray of bool (length N), optional

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

mode{'quad', 'polygon', 'auto'}, default: 'auto'

The fill mode. One of:

  • 'quad': A separate quadrilateral polygon is created for each pair of subsequent points in the two lines.

  • 'polygon': The two lines are connected to form a single polygon. This is faster and can render more cleanly for simple shapes (e.g. for filling between two lines that lie within a plane).

  • 'auto': If the points all lie on the same 3D plane, 'polygon' is used. Otherwise, 'quad' is used.

facecolorslist of color, default: None

Colors of each individual patch, or a single color to be used for all patches.

shadebool, default: None

Whether to shade the facecolors. If None, then defaults to True for 'quad' mode and False for 'polygon' mode.

axlim_clipbool, default: False

Whether to hide data that is outside the axes view limits.

Added in version 3.10.

**kwargs

All other keyword arguments are passed on to Poly3DCollection.

Returns:
Poly3DCollection

A Poly3DCollection containing the plotted polygons.

Examples using mpl_toolkits.mplot3d.axes3d.Axes3D.fill_between#

Fill between 3D lines

Fill between 3D lines

Fill under 3D line graphs

Fill under 3D line graphs

fill_between(x1, y1, z1, x2, y2, z2)

fill_between(x1, y1, z1, x2, y2, z2)