Plotter.add_light#
- Plotter.add_light(
- light: vtkLight,
- only_active: bool = False,
Add a Light to the scene.
- Parameters:
- light
Light| vtkLight The light to be added.
- only_activebool, default:
False If
True, only add the light to the active renderer. The default is that every renderer adds the light. To add the light to an arbitrary renderer, seepyvista.Renderer.add_light().
- light
Examples#
Download Python source code | Download Jupyter notebook
Create a plotter that we initialize with no lights, and add a cube and a single headlight to it.
>>> import pyvista as pv
>>> pl = pv.Plotter(lighting='none')
>>> _ = pl.add_mesh(pv.Cube())
>>> light = pv.Light(color='cyan', light_type='headlight')
>>> pl.add_light(light)
>>> pl.show()
Used In#
Guides
- Lights (2 uses)
Docstring Examples
Light.attenuation_values(1 use)Light.cone_angle(1 use)Light.exponent(1 use)Light.intensity(1 use)Light.show_actor(1 use)5 more
Plotter.enable_shadows(1 use)Renderer.enable_shadows(1 use)download_action_figure(1 use)download_louis_louvre(1 use)download_lucy(1 use)
Gallery Examples