pyvista.Chart2D.clear#
- Chart2D.clear(plot_type=None) None [source]#
Remove all plots of the specified type from this chart.
- Parameters:
- plot_type
str
,optional
The type of the plots to remove. Allowed types are
"scatter"
,"line"
,"area"
,"bar"
and"stack"
.If no type is provided (
None
), all plots are removed, regardless of their type.
- plot_type
Examples
Create a 2D chart with multiple line and scatter plot.
>>> import pyvista as pv >>> chart = pv.Chart2D() >>> _ = chart.plot([0, 1, 2], [2, 1, 3], 'o-b')
>>> _ = chart.plot([-2, -1, 0], [3, 1, 2], 'd-r')
>>> chart.show()
Remove all scatter plots from the chart.
>>> chart.clear('scatter') >>> chart.show()