Hi,

I think you may just need to convert the pixel ("scene") coordinates to the 
plot ("view") coordinates. There's a function to do this in ViewBox:

https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/viewbox.html#pyqtgraph.ViewBox.mapSceneToView

Typically, it might be used something like:

mousePoint = self.plot.getViewBox().mapSceneToView(pos)

where pos is a tuple of the scene coordinates, eg. the (110, 620) you are 
receiving from the event.

Patrick
On Thursday, 12 May 2022 at 11:04:44 am UTC+9:30 song whale wrote:

> Hello. I'm trying to get the coordinates of the mouse when clicked. 
> I get some values, but they don't correspond to the bar items on the 
> widget. 
> I'd like to know what I did wrong and what should be fixed.
> Please take a look at the code that I attached.
>
> [image: c.PNG]
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/ec1c563c-790c-4c33-8cd5-5fea16ded60dn%40googlegroups.com.

Reply via email to