pyvista.Plotter.enable_custom_trackball_style#
- Plotter.enable_custom_trackball_style(
- left='rotate',
- shift_left='pan',
- control_left='spin',
- middle='pan',
- shift_middle='pan',
- control_middle='pan',
- right='dolly',
- shift_right='environment_rotate',
- control_right='dolly',
Set the interactive style to a custom style based on Trackball Camera.
For each choice of button, control-button, and shift-button, the behavior when the mouse is moved can be chosen by passing the following strings:
"dolly"
"environment_rotate"
"pan"
"rotate"
"spin"
None
can also be passed, which also results in the default behavior.Added in version 0.44.0.
- Parameters:
- left
str
, default: “rotate” Action when the left button is clicked and the mouse is moved.
- shift_left
str
, default: “pan” Action when the left button is clicked with the shift key and the mouse is moved.
- control_left
str
, default: “spin” Action when the left button is clicked with the control key and mouse moved.
- middle
str
, default: “pan” Action when the middle button is clicked and the mouse is moved.
- shift_middle
str
, default: “pan” Action when the middle button is clicked with the shift key and the mouse is moved.
- control_middle
str
, default: “pan” Action when the middle button is clicked with the control key and mouse moved.
- right
str
, default: “dolly” Action when the right button is clicked and the mouse is moved.
- shift_right
str
, default: “environment_rotate” Action when the right button is clicked with the shift key and the mouse is moved.
- control_right
str
, default: “dolly” Action when the right button is clicked with the control key and the mouse is moved.
- left
See also
pyvista.Plotter.enable_trackball_style
Base style.
Examples
Create a simple scene with a plotter that has the left button dolly.
>>> 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_custom_trackball_style(left="dolly") >>> plotter.show()