-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[ENH]: mplot3d mouse rotation style #28408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not an expert in this topic, so do we really need all those impementations? I assume 99% of users just want that "it works", which means one good rotation style should be enough. |
I was originally of this opinion too - see #28290 (comment). |
This is the main thing I'm hoping to resolve, but I can see the different rotation modes being useful for different input devices / accessibility concerns. |
I have a PR in the works for it, almost ready, but I'm waiting for the merge of PR #28395, I'd prefer to finish one PR before starting another... |
I would go as far as to argue that rolling the axes in 3d is an anti-feature in most cases. The gain in flexibility makes it harder to control and achieve the desired view with mouse interactions. This is especially the case when viewing data that is plotted with z-direction being physically meaningful is some way (like a 3d histogram or wireframe with size in the z-direction measuring some quantity). From a visualisation perspective, rotating in azimuth is very useful here, while rolling is actually just annoying. Therefore I think it's essential that we are able to restore the old rotation behaviour on user request. I was envisioning something like holding down CNTRL key to toggle the rotation behaviour. |
I take it that you are very happy with the change proposed in this Issue, then?
This proposal I find puzzling - surely a CNTRL key does not mesh well with the 'principle of least surprise'? (And you want to hold it down? Or you want to toggle?) Could it be that what you really want is to constrain the roll to zero to keep the z axis parallel to the edge of the figure? That is a separate issue from having the rotation respond naturally to the mouse (i.e., move mouse to the left/right/up/down -> tilt figure to the left/right/up/down, consistently). Perhaps it deserves raising a separate Issue? (Feel free...) |
IMHO a rcParam for the rotation mode should be good enough (if we need multiple options). You can set this globally in your matplotlibrc, or you can set it before showing the figure. You'll hardly need to toggle different modes live. This makes implementation much simpler. |
Addresses Issue matplotlib#28408 - matplotlibrc: add axes3d.mouserotationstyle and axes3d.trackballsize - lib/matplotlib/rcsetup.py: add validation for axes3d.mouserotationstyle and axes3d.trackballsize - axes3d.py: implement various mouse rotation styles - update test_axes3d.py::test_rotate() - view_angles.rst: add documentation for the mouse rotation styles - update next_whats_new/mouse_rotation.rst
Problem
PR #28290 introduced more natural 3D rotation with the mouse. It uses a variation on Ken Shoemake's Arcball (it doesn't spin at double the mouse speed); however, this variation spoils a nice feature of the original Arcball (as Scott Shambaugh pointed out): if you move the mouse back the original point on the screen, this would return the view to the original view.
It would be desirable to be able to choose what kind of mouse rotation style one wants (Ken Shoemake's original Arcball, or the not-the-double-speed variation of the PR, or Holroyd's arcball, or a Trackball, or indeed the original matplotlib style which does not control
roll
, much like in matlab).Proposed solution
Make the mouse rotation style selectable using
rcParams
. Perhapsaxes3d.mouserotation
?The text was updated successfully, but these errors were encountered: