Plotter.orbit_on_path(path=None, focus=None, step=0.5, viewup=None, write_frames=False, threaded=False, progress_bar=False)#

Orbit on the given path focusing on the focus point.


Path of orbital points. The order in the points is the order of travel.

focuslist(float) of length 3, optional

The point of focus the camera.

stepfloat, optional

The timestep between flying to each camera position.

viewuplist(float), optional

The normal to the orbital plane.

write_framesbool, optional

Assume a file is open and write a frame on each camera view during the orbit.

threadedbool, optional

Run this as a background thread. Generally used within a GUI (i.e. PyQt).

progress_barbool, optional

Show the progress bar when proceeding through the path. This can be helpful to show progress when generating movies with off_screen=True.


Plot an orbit around the earth. Save the gif as a temporary file.

>>> import os
>>> from tempfile import mkdtemp
>>> import pyvista
>>> from pyvista import examples
>>> filename = os.path.join(mkdtemp(), 'orbit.gif')
>>> plotter = pyvista.Plotter(window_size=[300, 300])
>>> _ = plotter.add_mesh(examples.load_globe(), smooth_shading=True)
>>> plotter.open_gif(filename)
>>> viewup = [0, 0, 1]
>>> orbit = plotter.generate_orbital_path(factor=2.0, n_points=24,
...                                       shift=0.0, viewup=viewup)
>>> plotter.orbit_on_path(orbit, write_frames=True, viewup=viewup,
...                       step=0.02)

See Orbiting for a full example using this method.