pyvista.plotting.charts.LinePlot2D.update

pyvista.plotting.charts.LinePlot2D.update#

LinePlot2D.update(x, y) None[source]#

Update this plot’s points, through which a line is drawn.

Parameters:
xarray_like

The new x coordinates of the points through which a line should be drawn.

yarray_like

The new y coordinates of the points through which a line should be drawn.

Examples

Create a line plot.

>>> import pyvista as pv
>>> chart = pv.Chart2D()
>>> plot = chart.line([0, 1, 2], [2, 1, 3])
>>> chart.show()
../../../../_images/pyvista-plotting-charts-LinePlot2D-update-2_00_00.png

Update the line’s y coordinates.

>>> plot.update([0, 1, 2], [3, 1, 2])
>>> chart.show()
../../../../_images/pyvista-plotting-charts-LinePlot2D-update-2_01_00.png