_Prop3DMixin.position

_Prop3DMixin.position#

property _Prop3DMixin.position: tuple[float, float, float][source]#

Return or set the entity position.

Examples#

Download Python source code | Download Jupyter notebook

Change the position of an actor. Note how this does not change the position of the underlying dataset, just the relative location of the actor in the pyvista.Plotter.

>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh, color='b')
>>> actor = pl.add_mesh(mesh, color='r')
>>> actor.position = (0, 0, 1)  # shifts the red sphere up
>>> pl.show()
../../../_images/pyvista-plotting-prop3d-_Prop3DMixin-position-f4a2222718ea6e2e_00_00.png