Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: orientation indication shows up late in mplot3d, and then lingers  #28310

Closed
@MischaMegens2

Description

@MischaMegens2

Bug summary

When you rotate a 3d plot by pressing the left mouse button and moving the mouse, then in the corner of the figure toolbar, an indication of the orientation shows up ('Elevation, Azimuth, Roll', in degrees); it replaces the mouse coordinates ('x, y, z') that you see there normally (without the mouse button pressed). However, the orientation does not show up right away when you press the mouse button: only after you move the mouse.
Likewise, when you stopped moving, and release the mouse button, then the coordinates ('x, y, z') do not immediately reappear, but the orientation indication lingers (until you move the mouse again).
As a consequence, you cannot simply press-and-release the left mouse button to see the orientation (no orientation will show) - you have to change it to see it. It is counterintuitive.

Code for reproduction

python surfaced3d.py
# and then press the left mouse button (keep it depressed),
# and observe the indication (x, y, and z) in the corner.
# No orientation indication appears.

Actual outcome

Orientation information only appears after you move the mouse.
(And it lingers after you release the mouse button, i.e., the coordinate information does not immediately reappear.)

Expected outcome

Orientation information appears right away when you push the mouse button, and disappears right away when you release it.

Additional information

This appears to fix it:
In axes3d.py, at the end of
def _button_press(self, event):
and
def _button_release(self, event):
add the lines:

        if toolbar:
            toolbar.set_message(toolbar._mouse_event_to_message(event))

Operating system

All, presumably; but I noticed it on Windows

Matplotlib Version

3.10.0.dev203+gad9d1dd309.d20240527

Matplotlib Backend

tkagg

Python version

Python 3.12.3

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions