matplotlib.pyplot.fill#

matplotlib.pyplot.fill(*args,data=None,**kwargs)[source]#

Plot filled polygons.

Parameters:
*argssequence of x, y, [color]

Each polygon is defined by the lists ofx andy positions ofits nodes, optionally followed by acolor specifier. Seematplotlib.colors for supported color specifiers. Thestandard color cycle is used for polygons without a colorspecifier.

You can plot multiple polygons by providing multiplex,y,[color] groups.

For example, each of the following is legal:

ax.fill(x,y)# a polygon with default colorax.fill(x,y,"b")# a blue polygonax.fill(x,y,x2,y2)# two polygonsax.fill(x,y,"b",x2,y2,"r")# a blue and a red polygon
dataindexable object, optional

An object with labelled data. If given, provide the label names toplot inx andy, e.g.:

ax.fill("time","signal",data={"time":[0,1,2],"signal":[0,1,0]})
Returns:
list ofPolygon
Other Parameters:
**kwargsPolygon properties

Notes

Note

This is thepyplot wrapper foraxes.Axes.fill.

Usefill_between() if you would like to fill the region betweentwo curves.

Examples usingmatplotlib.pyplot.fill#

Interactive functions

Interactive functions

Filled polygon

Filled polygon

Fill spiral

Fill spiral