0
有什麼辦法可以檢測到鼠標關注的matplotlib對象嗎? 這樣的一段代碼,說明了什麼,我想matplotlib在鼠標事件時檢測對象
self.canvas.mpl_connect("motion_notify_event", self.on_focus)
def on_focus(self, event):
# get mouse position in figure
figPos = (event.x,event.y)
# get mouse position in axes if focusing on an axes
axesPos = event.xdata, event.ydata
# get axes instance if mouse is focusing on an axes
axes = event.inaxes
# get object (any matplotlib object, Text, Box, ...) mouse is focused on
obj = event.??????
感謝
你想知道whe ñ鼠標_懸停在對象上或只是在點擊它時? –
基本上當它徘徊...... – Cobry