Skip to content

How to get mousedown position in ui.matplotlib #3063

Closed Answered by falkoschindler
nghia-vo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @nghia-vo,

The event arguments e contain various attributes:

with ui.matplotlib(figsize=(8, 6)).on('click', lambda e: print(e.args)).figure as fig:
    fig.gca().imshow(np.random.rand(100, 100))

Output:

{'isTrusted': True, '_vts': 1715579733809, 'pointerId': 1, 'width': 1, 'height': 1, 'pressure': 0, 'tiltX': 0, 'tiltY': 0, 'azimuthAngle': 0, 'altitudeAngle': 1.5707963267948966, 'tangentialPressure': 0, 'twist': 0, 'pointerType': 'mouse', 'isPrimary': False, 'screenX': 464, 'screenY': 314, 'clientX': 464, 'clientY': 189, 'ctrlKey': False, 'shiftKey': False, 'altKey': False, 'metaKey': False, 'button': 0, 'buttons': 0, 'relatedTarget': None, 'pageX': 464, 'pageY': 189, 'x': 464, 'y': 18…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nghia-vo
Comment options

Answer selected by nghia-vo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants