pyvista.plotting.charts.StackPlot.update#

StackPlot.update(x, ys)[source]#

Update the locations and/or size of the stacks (areas) in this plot.

Parameters:
xarray_like

The new x coordinates of the stacks (areas) to draw.

yssequence[array_like]

The new sizes of the stacks (areas) to draw.

Examples

Create a stack plot.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot = chart.stack([0, 1, 2], [[2, 1, 3],[1, 2, 1]])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/1da92a1d9a8b73dfe4a5062000129646e12d7764/d8ad4/_images/pyvista-plotting-charts-stackplot-update-1_00_00.png

Update the stack sizes.

>>> plot.update([0, 1, 2], [[3, 1, 2], [0, 3, 1]])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/096b47d3ef5b592473f2c00bda01574e4738a17b/257db/_images/pyvista-plotting-charts-stackplot-update-1_01_00.png