pyvista.Plotter.remove_actor

pyvista.Plotter.remove_actor#

Plotter.remove_actor(actor, reset_camera=False, render=True)[ソース]#

レンダリングからアクターを削除します.

パラメータ:
actorstr | vtkActor | list | tuple

If the type is str, removes the previously added actor with the given name. If the type is vtkActor, removes the actor if it's previously added to the Renderer. If list or tuple, removes iteratively each actor.

reset_camerabool, optional

すべてのアクターが見えるようにカメラをリセットします.

renderbool, optional

アクターの除去時にレンダリングします.アクターが削除されたときにレンダリングウィンドウがレンダリングされないようにするには,これを False に設定します.

戻り値:
bool

アクターが削除された場合は True .アクターが削除されていない場合は False

2つのメッシュをプロッターに追加し,球体のアクタを削除します.

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> pl = pv.Plotter()
>>> cube_actor = pl.add_mesh(pv.Cube(), show_edges=True)
>>> sphere_actor = pl.add_mesh(pv.Sphere(), show_edges=True)
>>> _ = pl.remove_actor(cube_actor)
>>> pl.show()
../../../_images/pyvista-Plotter-remove_actor-1_00_00.png