Plotter.set_focus

Plotter.set_focus#

Plotter.set_focus(point: VectorLike[float], *, render: bool = True) → None[source]#

Set focus to a point.

Parameters:
pointsequence[float]

Cartesian point to focus on in the form of [x, y, z].

renderbool, default: True

If the render window is being shown, trigger a render after setting the focus.

Added in version 0.50.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh, show_edges=True)
>>> _ = pl.add_point_labels([mesh.points[1]], ['Focus'])
>>> _ = pl.camera  # this initializes the camera
>>> pl.set_focus(mesh.points[1])
>>> pl.show()
../../../_images/pyvista-Plotter-set_focus-8995ddd01d674688_00_00.png