Axes.fill(*args, **kwargs)¶Plot filled polygons.
Call signature:
fill(*args, **kwargs)
args is a variable length argument, allowing for multiple
x, y pairs with an optional color format string; see
plot() for details on the argument
parsing. For example, to plot a polygon with vertices at x,
y in blue.:
ax.fill(x,y, 'b' )
An arbitrary number of x, y, color groups can be specified:
ax.fill(x1, y1, 'g', x2, y2, 'r')
Return value is a list of Patch
instances that were added.
The same color strings that plot()
supports are supported by the fill format string.
If you would like to fill below a curve, e.g., shade a region
between 0 and y along x, use fill_between()
The closed kwarg will close the polygon when True (default).
kwargs control the Polygon properties:
Property Description agg_filterunknown alphafloat or None animated[True | False] antialiasedor aa[True | False] or None for default axesan Axesinstancebottom_marginunknown capstyle[‘butt’ | ‘round’ | ‘projecting’] clip_boxa matplotlib.transforms.Bboxinstanceclip_on[True | False] clip_path[ ( Path,Transform) |Patch| None ]colormatplotlib color spec containsa callable function edgecoloror ecmpl color spec, None, ‘none’, or ‘auto’ facecoloror fcmpl color spec, or None for default, or ‘none’ for no color figurea matplotlib.figure.Figureinstancefill[True | False] gidan id string hatch[‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’] joinstyle[‘miter’ | ‘round’ | ‘bevel’] labelstring or anything printable with ‘%s’ conversion. left_marginunknown linestyleor ls[‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) | '-'|'--'|'-.'|':'|'None'|' '|'']linewidthor lwfloat or None for default marginsunknown path_effectsunknown picker[None|float|boolean|callable] rasterized[True | False | None] right_marginunknown sketch_paramsunknown snapunknown top_marginunknown transformTransforminstanceurla url string visible[True | False] zorderany number
Example:
(Source code, png, pdf)
Notes
In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]: