Plotter.reset_camera#
- Plotter.reset_camera(
- *,
- render: bool = True,
- bounds: VectorLikeFloat | None = None,
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.
- bounds
VectorLikeFloat, optional Automatically set up the camera based on a specified bounding box
(x_min, x_max, y_min, y_max, z_min, z_max).
- renderbool, default:
Examples#
Download Python source code | Download Jupyter notebook
Add a mesh and place the camera position too close to the mesh. Then reset the camera and show the mesh.
>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(pv.Sphere(), show_edges=True)
>>> pl.set_position((0, 0.1, 0.1))
>>> pl.reset_camera()
>>> pl.show()
Used In#
API Examples
Renderer.reset_camera(1 use)