Catching mouse movements only within plot area...

38 views
Skip to first unread message

Jeremy Webster

unread,
Nov 7, 2017, 6:29:53 PM11/7/17
to pyqtgraph
The Crosshair/Mouse interaction example catches mouse movements within the Scene Bounding Rectangle as shown here...


def mouseMoved(evt):
pos = evt[0]

if p1.sceneBoundingRect().contains(pos):

mousePoint = vb.mapSceneToView(pos)



This will include when the mouse is over the axis labels as well as when it's over the actual plot area.

Is there a quick way to capture mouse movements/clicks ONLY within the plot area?  Or do I need to take the Bounding Rect and remove the heights/widths of the axis labels/titles etc?



Reply all
Reply to author
Forward
0 new messages