- Renderer.remove_actor(actor, reset_camera=False, render=True)¶
Remove an actor from the Renderer.
If the type is
str, removes the previously added actor with the given name. If the type is
vtk.vtkActor, removes the actor if it’s previously added to the Renderer. If
tuple, removes iteratively each actor.
Resets camera so all actors can be seen.
Render upon actor removal. Set this to
Falseto stop the render window from rendering when an actor is removed.
Truewhen actor removed.
Falsewhen actor has not been removed.
Add two meshes to a plotter and then remove the sphere actor.
>>> import pyvista >>> mesh = pyvista.Cube() >>> pl = pyvista.Plotter() >>> cube_actor = pl.add_mesh(pyvista.Cube(), show_edges=True) >>> sphere_actor = pl.add_mesh(pyvista.Sphere(), show_edges=True) >>> _ = pl.remove_actor(cube_actor) >>> pl.show()