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_projectionSet parallel projection, which is useful for 2D views.
pyvista.Plotter.enable_custom_trackball_styleA style that can be customized for mouse actions.
Examples#
Download Python source code | Download Jupyter notebook
Create a simple scene with a plotter that has a ParaView-like 2D style:
>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(pv.Cube(center=(1, 0, 0)))
>>> _ = pl.add_mesh(pv.Cube(center=(0, 1, 0)))
>>> pl.show_axes()
>>> pl.enable_parallel_projection()
>>> pl.enable_2d_style()
>>> pl.show()