pyvista.RenderWindowInteractor.enable_2d_style#
- RenderWindowInteractor.enable_2d_style()[source]#
Set the interactive style to 2D.
For a 3-button mouse, the left button pans, the right button dollys, the middle button spins, and the wheel dollys. ctrl + left button spins, shift + left button dollys, ctrl + middle button pans, shift + middle button dollys, ctrl + right button rotates in 3D, and shift + right button dollys.
Recommended to use with
pyvista.Plotter.enable_parallel_projection()
.See also
pyvista.Plotter.enable_parallel_projection
Set parallel projection, which is useful for 2D views.
pyvista.Plotter.enable_custom_trackball_style
A style that can be customized for mouse actions.
Examples
Create a simple scene with a plotter that has a ParaView-like 2D style:
>>> import pyvista as pv >>> plotter = pv.Plotter() >>> _ = plotter.add_mesh(pv.Cube(center=(1, 0, 0))) >>> _ = plotter.add_mesh(pv.Cube(center=(0, 1, 0))) >>> plotter.show_axes() >>> plotter.enable_parallel_projection() >>> plotter.enable_2d_style() >>> plotter.show()