pyvista.Plotter.reset_camera#

Plotter.reset_camera(render=True, bounds=None)[source]#

Reset the camera of the active render window.

The camera slides along the vector defined from camera position to focal point until all of the actors can be seen.

Parameters:
renderbool, default: True

Trigger a render after resetting the camera.

boundsiterable(int), optional

Automatically set up the camera based on a specified bounding box (xmin, xmax, ymin, ymax, zmin, zmax).

Examples

Add a mesh and place the camera position too close to the mesh. Then reset the camera and show the mesh.

>>> import pyvista
>>> pl = pyvista.Plotter()
>>> actor = pl.add_mesh(pyvista.Sphere(), show_edges=True)
>>> pl.set_position((0, 0.1, 0.1))
>>> pl.reset_camera()
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/5b83f898aae4878c6669ac7d3601092b0b3a144a/6d6ae/_images/pyvista-plotter-reset_camera-1_00_00.png