pyvista.Chart2D.remove_plot#

Chart2D.remove_plot(plot)[source]#

Remove the given plot from this chart.

Parameters:
plotplotting.charts.ScatterPlot2D | plotting.charts.LinePlot2D | plotting.charts.AreaPlot | plotting.charts.BarPlot | plotting.charts.StackPlot

The plot to remove.

Examples

Create a 2D chart with a line and scatter plot.

>>> import pyvista as pv
>>> chart = pv.Chart2D()
>>> scatter_plot, line_plot = chart.plot([0, 1, 2], [2, 1, 3], "o-")
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/82d4b780513c5349a60ea96fe6a93f59b2af7bd4/ffad5/_images/pyvista-chart2d-remove_plot-2_01_00.png

Remove the scatter plot from the chart.

>>> chart.remove_plot(scatter_plot)
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/f46aa1528fc88fbfbde123eb6aa648cfb8c52a8b/a4133/_images/pyvista-chart2d-remove_plot-2_02_00.png