pyvista.Plotter.camera_position#

property Plotter.camera_position[source]#

Return camera position of the active render window.

Examples

Return camera’s position and then reposition it via a list of tuples.

>>> import pyvista as pv
>>> from pyvista import examples
>>> mesh = examples.download_bunny_coarse()
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh, show_edges=True, reset_camera=True)
>>> pl.camera_position
[(0.02430, 0.0336, 0.9446),
 (0.02430, 0.0336, -0.02225),
 (0.0, 1.0, 0.0)]
>>> pl.camera_position = [
...     (0.3914, 0.4542, 0.7670),
...     (0.0243, 0.0336, -0.0222),
...     (-0.2148, 0.8998, -0.3796),
... ]
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/cf3c8bc2b92f0165f414ba34b896ceebe1e406fd/428c8/_images/pyvista-plotter-camera_position-1_00_00.png

Set the camera position using a string and look at the 'xy' plane.

>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh, show_edges=True)
>>> pl.camera_position = 'xy'
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/5025b424b78cbd7b8b2984875360e4f658a39707/abcfb/_images/pyvista-plotter-camera_position-1_01_00.png

Set the camera position using a string and look at the 'zy' plane.

>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh, show_edges=True)
>>> pl.camera_position = 'zy'
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/67bbe19b3364f9f167709b81fd6561e8e5ebe615/b2bef/_images/pyvista-plotter-camera_position-1_02_00.png

For more examples, see Cameras.