area#

Chart2D.area(x, y1, y2=None, color='b', label='')[source]#

Add an area plot to this chart.

Parameters
xarray_like

X coordinates of the points outlining the area to draw.

y1array_like

Y coordinates of the points on the first outline of the area to draw.

y2array_like, optional

Y coordinates of the points on the second outline of the area to draw. Defaults to a sequence of zeros.

colorcolor_like, optional

Color of the area drawn in this plot. Any color parsable by pyvista.Color is allowed. Defaults to "b".

labelstr, optional

Label of this plot, as shown in the chart’s legend. Defaults to "".

Returns
plotting.charts.AreaPlot

The created area plot.

Examples

Generate an area plot.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot = chart.area([0, 1, 2], [2, 1, 3])
>>> chart.show()
../../../../_images/pyvista-Chart2D-area-1_00_00.png