pyvista.plotting.charts.ScatterPlot2D.update#

ScatterPlot2D.update(x, y)[source]#

Update this plot’s points.

Parameters:
xarray_like

The new x coordinates of the points to draw.

yarray_like

The new y coordinates of the points to draw.

Examples

Create a scatter plot.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot = chart.scatter([0, 1, 2, 3, 4], [2, 1, 3, 4, 2])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/311dfea36405ce6cdc07606a326b69552d6668f1/facf3/_images/pyvista-plotting-charts-scatterplot2d-update-1_00_00.png

Update the marker locations.

>>> plot.update([0, 1, 2, 3, 4], [3, 2, 4, 2, 1])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/ce4ef985c7e133fd1c1f825c3eb6b0a281b11b2a/e26ca/_images/pyvista-plotting-charts-scatterplot2d-update-1_01_00.png