pyvista.plotting.charts.BoxPlot.update#

BoxPlot.update(data)[source]#

Update the plot’s underlying dataset(s).

Parameters:
datasequence[array_like]

The new dataset(s) used in this box plot.

Examples

Create a box plot from a standard Gaussian dataset.

>>> import pyvista as pv
>>> import numpy as np
>>> rng = np.random.default_rng(1)  # Seeded random number generator for data generation
>>> chart = pv.ChartBox([rng.normal(size=100)])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/29c0e1e5f10c5a238c24974358bafcf5cda6228c/1313e/_images/pyvista-plotting-charts-boxplot-update-2_00_00.png

Update the box plot (shift the standard Gaussian distribution).

>>> chart.plot.update([rng.normal(loc=2, size=100)])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/0f39c61a67ca51067955de9be2cd1c3181772534/620b3/_images/pyvista-plotting-charts-boxplot-update-2_01_00.png