Plotter.clear_slider_widgets#
Examples#
Download Python source code | Download Jupyter notebook
Add a slider that controls a mesh’s opacity, then clear it.
>>> import pyvista as pv
>>> pl = pv.Plotter(off_screen=True)
>>> actor = pl.add_mesh(pv.Sphere())
>>> def set_opacity(value):
... actor.prop.opacity = value
>>> _ = pl.add_slider_widget(set_opacity, [0, 1], title='Opacity')
>>> len(pl.widgets.slider_widgets)
1
>>> pl.clear_slider_widgets()
>>> len(pl.widgets.slider_widgets)
0
>>> pl.close()
Used In#
API Examples